1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 09:27:34 +08:00

Improve notification overlay test robustness (#7368)

Improve notification overlay test robustness
This commit is contained in:
Dean Herbert 2019-12-27 09:28:48 +09:00 committed by GitHub
commit 39cfe848e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,9 +67,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddRepeatStep(@"add many simple", sendManyNotifications, 3);
AddWaitStep("wait some", 5);
checkProgressingCount(0);
waitForCompletion();
AddStep(@"progress #3", sendUploadProgress);
@ -77,9 +75,7 @@ namespace osu.Game.Tests.Visual.UserInterface
checkDisplayedCount(33);
AddWaitStep("wait some", 10);
checkProgressingCount(0);
waitForCompletion();
}
[Test]
@ -109,9 +105,9 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep(@"background progress #1", sendBackgroundUploadProgress);
AddWaitStep("wait some", 5);
checkProgressingCount(1);
checkProgressingCount(0);
waitForCompletion();
checkDisplayedCount(2);
@ -190,6 +186,8 @@ namespace osu.Game.Tests.Visual.UserInterface
private void checkProgressingCount(int expected) => AddAssert($"progressing count is {expected}", () => progressingNotifications.Count == expected);
private void waitForCompletion() => AddUntilStep("wait for notification progress completion", () => progressingNotifications.Count == 0);
private void sendBarrage()
{
switch (RNG.Next(0, 4))