From b0f6a87a2b6119f82c6219f73363e6c6578d0d2d Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Thu, 1 Feb 2024 15:35:23 +0300 Subject: [PATCH] Add stress test in TestSceneDashboardOverlay --- .../Online/TestSceneDashboardOverlay.cs | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs index 9407941da6..b6a300322f 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs @@ -2,14 +2,15 @@ // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; namespace osu.Game.Tests.Visual.Online { public partial class TestSceneDashboardOverlay : OsuTestScene { - protected override bool UseOnlineAPI => true; - private readonly DashboardOverlay overlay; public TestSceneDashboardOverlay() @@ -17,6 +18,30 @@ namespace osu.Game.Tests.Visual.Online Add(overlay = new DashboardOverlay()); } + [BackgroundDependencyLoader] + private void load() + { + int supportLevel = 0; + + for (int i = 0; i < 1000; i++) + { + supportLevel++; + + if (supportLevel > 3) + supportLevel = 0; + + ((DummyAPIAccess)API).Friends.Add(new APIUser + { + Username = @"peppy", + Id = 2, + Colour = "99EB47", + CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg", + IsSupporter = supportLevel > 0, + SupportLevel = supportLevel + }); + } + } + [Test] public void TestShow() {