Rename usages which rely on online backing

This commit is contained in:
Dean Herbert
2021-10-21 16:53:50 +09:00
parent 0706ad70fb
commit 32d01f022f
10 changed files with 32 additions and 32 deletions

View File

@ -23,21 +23,21 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestLocal([Values] BeatmapSetCoverType coverType)
{
AddStep("setup cover", () => Child = new UpdateableBeatmapSetCover(coverType)
AddStep("setup cover", () => Child = new UpdateableOnlineBeatmapSetCover(coverType)
{
BeatmapSet = CreateBeatmap(Ruleset.Value).BeatmapInfo.BeatmapSet,
RelativeSizeAxes = Axes.Both,
Masking = true,
});
AddUntilStep("wait for load", () => this.ChildrenOfType<BeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);
AddUntilStep("wait for load", () => this.ChildrenOfType<OnlineBeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);
}
[Test]
public void TestUnloadAndReload()
{
OsuScrollContainer scroll = null;
List<UpdateableBeatmapSetCover> covers = new List<UpdateableBeatmapSetCover>();
List<UpdateableOnlineBeatmapSetCover> covers = new List<UpdateableOnlineBeatmapSetCover>();
AddStep("setup covers", () =>
{
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual.UserInterface
{
var coverType = coverTypes[i % coverTypes.Count];
var cover = new UpdateableBeatmapSetCover(coverType)
var cover = new UpdateableOnlineBeatmapSetCover(coverType)
{
BeatmapSet = setInfo,
Height = 100,
@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.UserInterface
}
});
var loadedCovers = covers.Where(c => c.ChildrenOfType<BeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);
var loadedCovers = covers.Where(c => c.ChildrenOfType<OnlineBeatmapSetCover>().SingleOrDefault()?.IsLoaded ?? false);
AddUntilStep("some loaded", () => loadedCovers.Any());
AddStep("scroll to end", () => scroll.ScrollToEnd());
@ -95,9 +95,9 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestSetNullBeatmapWhileLoading()
{
TestUpdateableBeatmapSetCover updateableCover = null;
TestUpdateableOnlineBeatmapSetCover updateableCover = null;
AddStep("setup cover", () => Child = updateableCover = new TestUpdateableBeatmapSetCover
AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover
{
BeatmapSet = CreateBeatmap(Ruleset.Value).BeatmapInfo.BeatmapSet,
RelativeSizeAxes = Axes.Both,
@ -112,10 +112,10 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestCoverChangeOnNewBeatmap()
{
TestUpdateableBeatmapSetCover updateableCover = null;
BeatmapSetCover initialCover = null;
TestUpdateableOnlineBeatmapSetCover updateableCover = null;
OnlineBeatmapSetCover initialCover = null;
AddStep("setup cover", () => Child = updateableCover = new TestUpdateableBeatmapSetCover(0)
AddStep("setup cover", () => Child = updateableCover = new TestUpdateableOnlineBeatmapSetCover(0)
{
BeatmapSet = createBeatmapWithCover("https://assets.ppy.sh/beatmaps/1189904/covers/cover.jpg"),
RelativeSizeAxes = Axes.Both,
@ -123,13 +123,13 @@ namespace osu.Game.Tests.Visual.UserInterface
Alpha = 0.4f
});
AddUntilStep("cover loaded", () => updateableCover.ChildrenOfType<BeatmapSetCover>().Any());
AddStep("store initial cover", () => initialCover = updateableCover.ChildrenOfType<BeatmapSetCover>().Single());
AddUntilStep("cover loaded", () => updateableCover.ChildrenOfType<OnlineBeatmapSetCover>().Any());
AddStep("store initial cover", () => initialCover = updateableCover.ChildrenOfType<OnlineBeatmapSetCover>().Single());
AddUntilStep("wait for fade complete", () => initialCover.Alpha == 1);
AddStep("switch beatmap",
() => updateableCover.BeatmapSet = createBeatmapWithCover("https://assets.ppy.sh/beatmaps/1079428/covers/cover.jpg"));
AddUntilStep("new cover loaded", () => updateableCover.ChildrenOfType<BeatmapSetCover>().Except(new[] { initialCover }).Any());
AddUntilStep("new cover loaded", () => updateableCover.ChildrenOfType<OnlineBeatmapSetCover>().Except(new[] { initialCover }).Any());
}
private static BeatmapSetInfo createBeatmapWithCover(string coverUrl) => new BeatmapSetInfo
@ -140,11 +140,11 @@ namespace osu.Game.Tests.Visual.UserInterface
}
};
private class TestUpdateableBeatmapSetCover : UpdateableBeatmapSetCover
private class TestUpdateableOnlineBeatmapSetCover : UpdateableOnlineBeatmapSetCover
{
private readonly int loadDelay;
public TestUpdateableBeatmapSetCover(int loadDelay = 10000)
public TestUpdateableOnlineBeatmapSetCover(int loadDelay = 10000)
{
this.loadDelay = loadDelay;
}
@ -154,7 +154,7 @@ namespace osu.Game.Tests.Visual.UserInterface
if (model == null)
return null;
return new TestBeatmapSetCover(model, loadDelay)
return new TestOnlineBeatmapSetCover(model, loadDelay)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -164,11 +164,11 @@ namespace osu.Game.Tests.Visual.UserInterface
}
}
private class TestBeatmapSetCover : BeatmapSetCover
private class TestOnlineBeatmapSetCover : OnlineBeatmapSetCover
{
private readonly int loadDelay;
public TestBeatmapSetCover(IBeatmapSetOnlineInfo set, int loadDelay)
public TestOnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, int loadDelay)
: base(set)
{
this.loadDelay = loadDelay;