mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Add test coverage of update notification
This commit is contained in:
parent
eca241e9a7
commit
2b79e6b2de
@ -12,6 +12,7 @@ using osu.Framework.Utils;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
|
using osu.Game.Updater;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
{
|
{
|
||||||
@ -134,6 +135,31 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep("cancel notification", () => notification.State = ProgressNotificationState.Cancelled);
|
AddStep("cancel notification", () => notification.State = ProgressNotificationState.Cancelled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestUpdateNotificationFlow()
|
||||||
|
{
|
||||||
|
bool applyUpdate = false;
|
||||||
|
|
||||||
|
AddStep(@"post update", () =>
|
||||||
|
{
|
||||||
|
applyUpdate = false;
|
||||||
|
|
||||||
|
var updateNotification = new UpdateManager.UpdateProgressNotification
|
||||||
|
{
|
||||||
|
CompletionClickAction = () => applyUpdate = true
|
||||||
|
};
|
||||||
|
|
||||||
|
notificationOverlay.Post(updateNotification);
|
||||||
|
progressingNotifications.Add(updateNotification);
|
||||||
|
});
|
||||||
|
|
||||||
|
checkProgressingCount(1);
|
||||||
|
waitForCompletion();
|
||||||
|
AddStep("click notification", () => notificationOverlay.ChildrenOfType<Notification>().Single().TriggerClick());
|
||||||
|
|
||||||
|
AddUntilStep("wait for update applied", () => applyUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBasicFlow()
|
public void TestBasicFlow()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user