mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Add test for relative sizing scenarios
This commit is contained in:
parent
dacbbb5eee
commit
38d9a46ffb
@ -21,12 +21,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingSpinner) };
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(LoadingSpinner) };
|
||||||
|
|
||||||
|
private Container content;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() =>
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
Size = new Vector2(300),
|
Size = new Vector2(300),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -60,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ShowHide()
|
public void TestShowHide()
|
||||||
{
|
{
|
||||||
AddAssert("not visible", () => !overlay.IsPresent);
|
AddAssert("not visible", () => !overlay.IsPresent);
|
||||||
|
|
||||||
@ -74,7 +76,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ContentRestoreOnDispose()
|
public void TestContentRestoreOnDispose()
|
||||||
{
|
{
|
||||||
AddAssert("not visible", () => !overlay.IsPresent);
|
AddAssert("not visible", () => !overlay.IsPresent);
|
||||||
|
|
||||||
@ -82,9 +84,23 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddUntilStep("wait for content dim", () => dimContent.Colour != Color4.White);
|
AddUntilStep("wait for content dim", () => dimContent.Colour != Color4.White);
|
||||||
|
|
||||||
AddStep("hide", () => overlay.Expire());
|
AddStep("expire", () => overlay.Expire());
|
||||||
|
|
||||||
AddUntilStep("wait for content restore", () => dimContent.Colour == Color4.White);
|
AddUntilStep("wait for content restore", () => dimContent.Colour == Color4.White);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestLargeArea()
|
||||||
|
{
|
||||||
|
AddStep("show", () =>
|
||||||
|
{
|
||||||
|
content.RelativeSizeAxes = Axes.Both;
|
||||||
|
content.Size = new Vector2(1);
|
||||||
|
|
||||||
|
overlay.Show();
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("hide", () => overlay.Hide());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user