mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 06:32:55 +08:00
Update test cases to new framework and fix old crashes
This commit is contained in:
parent
26c40105e2
commit
22a987f6cc
@ -1 +1 @@
|
|||||||
Subproject commit cd2b351de37f17b6d91d1fc062627208a09c3834
|
Subproject commit b0909ce13389ba690bfc41232d2d39bdf175e896
|
@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Beatmap details in song select";
|
public override string Description => @"Beatmap details in song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapDetailArea()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new BeatmapDetailArea
|
Add(new BeatmapDetailArea
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private BeatmapDetails details;
|
private BeatmapDetails details;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapDetails()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(details = new BeatmapDetails
|
Add(details = new BeatmapDetails
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Beatmap options in song select";
|
public override string Description => @"Beatmap options in song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBeatmapOptionsOverlay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
var overlay = new BeatmapOptionsOverlay();
|
var overlay = new BeatmapOptionsOverlay();
|
||||||
|
|
||||||
overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
|
overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"breadcrumb > control";
|
public override string Description => @"breadcrumb > control";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseBreadcrumbs()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
BreadcrumbControl<BreadcrumbTab> c;
|
BreadcrumbControl<BreadcrumbTab> c;
|
||||||
Add(c = new BreadcrumbControl<BreadcrumbTab>
|
Add(c = new BreadcrumbControl<BreadcrumbTab>
|
||||||
{
|
{
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Testing chat api and overlay";
|
public override string Description => @"Testing chat api and overlay";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseChatDisplay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new ChatOverlay
|
Add(new ChatOverlay
|
||||||
{
|
{
|
||||||
State = Visibility.Visible
|
State = Visibility.Visible
|
||||||
|
@ -23,10 +23,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private MyContextMenuContainer container;
|
private MyContextMenuContainer container;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseContextMenu()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(container = new MyContextMenuContainer
|
Add(container = new MyContextMenuContainer
|
||||||
{
|
{
|
||||||
Size = new Vector2(200),
|
Size = new Vector2(200),
|
||||||
|
@ -14,10 +14,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private DialogOverlay overlay;
|
private DialogOverlay overlay;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseDialogOverlay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(overlay = new DialogOverlay());
|
Add(overlay = new DialogOverlay());
|
||||||
|
|
||||||
AddStep("dialog #1", () => overlay.Push(new PopupDialog
|
AddStep("dialog #1", () => overlay.Push(new PopupDialog
|
||||||
|
@ -16,9 +16,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private DirectOverlay direct;
|
private DirectOverlay direct;
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(direct = new DirectOverlay());
|
Add(direct = new DirectOverlay());
|
||||||
newBeatmaps();
|
newBeatmaps();
|
||||||
|
@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Select your favourite room";
|
public override string Description => @"Select your favourite room";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
DrawableRoom first;
|
DrawableRoom first;
|
||||||
DrawableRoom second;
|
DrawableRoom second;
|
||||||
|
@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => "Tournament drawings";
|
public override string Description => "Tournament drawings";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseDrawings()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Drawings
|
Add(new Drawings
|
||||||
{
|
{
|
||||||
TeamList = new TestTeamList(),
|
TeamList = new TestTeamList(),
|
||||||
|
@ -34,9 +34,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
List<HitObject> objects = new List<HitObject>();
|
List<HitObject> objects = new List<HitObject>();
|
||||||
|
|
||||||
|
@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private BarGraph graph;
|
private BarGraph graph;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseGraph()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
graph = new BarGraph
|
graph = new BarGraph
|
||||||
|
@ -29,6 +29,49 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
var rateAdjustClock = new StopwatchClock(true);
|
var rateAdjustClock = new StopwatchClock(true);
|
||||||
framedClock = new FramedClock(rateAdjustClock);
|
framedClock = new FramedClock(rateAdjustClock);
|
||||||
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
|
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
|
||||||
|
|
||||||
|
playbackSpeed.TriggerChange();
|
||||||
|
|
||||||
|
AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle));
|
||||||
|
AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider));
|
||||||
|
AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner));
|
||||||
|
|
||||||
|
AddToggleStep(@"auto", state => { auto = state; loadHitobjects(mode); });
|
||||||
|
|
||||||
|
BasicSliderBar<double> sliderBar;
|
||||||
|
Add(new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SpriteText { Text = "Playback Speed" },
|
||||||
|
sliderBar = new BasicSliderBar<double>
|
||||||
|
{
|
||||||
|
Width = 150,
|
||||||
|
Height = 10,
|
||||||
|
SelectionColor = Color4.Orange,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
sliderBar.Current.BindTo(playbackSpeed);
|
||||||
|
|
||||||
|
framedClock.ProcessFrame();
|
||||||
|
|
||||||
|
var clockAdjustContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Clock = framedClock,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
|
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Add(clockAdjustContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HitObjectType mode = HitObjectType.Slider;
|
private HitObjectType mode = HitObjectType.Slider;
|
||||||
@ -37,7 +80,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private Container playfieldContainer;
|
private Container playfieldContainer;
|
||||||
private Container approachContainer;
|
private Container approachContainer;
|
||||||
|
|
||||||
private void load(HitObjectType mode)
|
private void loadHitobjects(HitObjectType mode)
|
||||||
{
|
{
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
|
|
||||||
@ -83,54 +126,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
playbackSpeed.TriggerChange();
|
|
||||||
|
|
||||||
AddStep(@"circles", () => load(HitObjectType.Circle));
|
|
||||||
AddStep(@"slider", () => load(HitObjectType.Slider));
|
|
||||||
AddStep(@"spinner", () => load(HitObjectType.Spinner));
|
|
||||||
|
|
||||||
AddToggleStep(@"auto", state => { auto = state; load(mode); });
|
|
||||||
|
|
||||||
BasicSliderBar<double> sliderBar;
|
|
||||||
Add(new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new SpriteText { Text = "Playback Speed" },
|
|
||||||
sliderBar = new BasicSliderBar<double>
|
|
||||||
{
|
|
||||||
Width = 150,
|
|
||||||
Height = 10,
|
|
||||||
SelectionColor = Color4.Orange,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderBar.Current.BindTo(playbackSpeed);
|
|
||||||
|
|
||||||
framedClock.ProcessFrame();
|
|
||||||
|
|
||||||
var clockAdjustContainer = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Clock = framedClock,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
|
|
||||||
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Add(clockAdjustContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int depth;
|
private int depth;
|
||||||
|
|
||||||
private void add(DrawableOsuHitObject h)
|
private void add(DrawableOsuHitObject h)
|
||||||
|
@ -20,10 +20,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests key counter";
|
public override string Description => @"Tests key counter";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseKeyCounter()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
KeyCounterCollection kc = new KeyCounterCollection
|
KeyCounterCollection kc = new KeyCounterCollection
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -207,10 +207,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
leaderboard.Scores = scores;
|
leaderboard.Scores = scores;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseLeaderboard()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(leaderboard = new Leaderboard
|
Add(leaderboard = new Leaderboard
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
internal class TestCaseManiaHitObjects : TestCase
|
internal class TestCaseManiaHitObjects : TestCase
|
||||||
{
|
{
|
||||||
public override void Reset()
|
public TestCaseManiaHitObjects()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -25,10 +25,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
protected override double TimePerAction => 200;
|
protected override double TimePerAction => 200;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseManiaPlayfield()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
|
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Main menu button system";
|
public override string Description => @"Main menu button system";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseMenuButtonSystem()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
|
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
|
||||||
|
@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private FailOverlay failOverlay;
|
private FailOverlay failOverlay;
|
||||||
private int retryCount;
|
private int retryCount;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseMenuOverlays()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
retryCount = 0;
|
retryCount = 0;
|
||||||
|
|
||||||
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
||||||
|
@ -27,9 +27,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(modSelect = new ModSelectOverlay
|
Add(modSelect = new ModSelectOverlay
|
||||||
{
|
{
|
||||||
|
@ -18,12 +18,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
public TestCaseMusicController()
|
public TestCaseMusicController()
|
||||||
{
|
{
|
||||||
Clock = new FramedClock();
|
Clock = new FramedClock();
|
||||||
}
|
|
||||||
|
|
||||||
public override void Reset()
|
|
||||||
{
|
|
||||||
base.Reset();
|
|
||||||
Clock.ProcessFrame();
|
|
||||||
mc = new MusicController
|
mc = new MusicController
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -18,10 +18,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private NotificationManager manager;
|
private NotificationManager manager;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseNotificationManager()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
progressingNotifications.Clear();
|
progressingNotifications.Clear();
|
||||||
|
|
||||||
Content.Add(manager = new NotificationManager
|
Content.Add(manager = new NotificationManager
|
||||||
|
@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
public override string Description => @"Make it easier to see setting changes";
|
public override string Description => @"Make it easier to see setting changes";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new OnScreenDisplay());
|
Add(new OnScreenDisplay());
|
||||||
|
|
||||||
|
@ -21,9 +21,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCasePlaySongSelect()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
if (db == null)
|
if (db == null)
|
||||||
{
|
{
|
||||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||||
|
@ -33,53 +33,46 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
this.db = db;
|
this.db = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
WorkingBeatmap beatmap = null;
|
WorkingBeatmap beatmap = null;
|
||||||
|
|
||||||
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.RulesetID == 0);
|
var objects = new List<HitObject>();
|
||||||
if (beatmapInfo != null)
|
|
||||||
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
|
||||||
|
|
||||||
if (beatmap?.Track == null)
|
int time = 1500;
|
||||||
|
for (int i = 0; i < 50; i++)
|
||||||
{
|
{
|
||||||
var objects = new List<HitObject>();
|
objects.Add(new HitCircle
|
||||||
|
|
||||||
int time = 1500;
|
|
||||||
for (int i = 0; i < 50; i++)
|
|
||||||
{
|
{
|
||||||
objects.Add(new HitCircle
|
StartTime = time,
|
||||||
{
|
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
||||||
StartTime = time,
|
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
||||||
Position = new Vector2(i % 4 == 0 || i % 4 == 2 ? 0 : OsuPlayfield.BASE_SIZE.X,
|
NewCombo = i % 4 == 0
|
||||||
i % 4 < 2 ? 0 : OsuPlayfield.BASE_SIZE.Y),
|
});
|
||||||
NewCombo = i % 4 == 0
|
|
||||||
});
|
|
||||||
|
|
||||||
time += 500;
|
time += 500;
|
||||||
}
|
|
||||||
|
|
||||||
Beatmap b = new Beatmap
|
|
||||||
{
|
|
||||||
HitObjects = objects,
|
|
||||||
BeatmapInfo = new BeatmapInfo
|
|
||||||
{
|
|
||||||
Difficulty = new BeatmapDifficulty(),
|
|
||||||
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
|
||||||
Metadata = new BeatmapMetadata
|
|
||||||
{
|
|
||||||
Artist = @"Unknown",
|
|
||||||
Title = @"Sample Beatmap",
|
|
||||||
Author = @"peppy",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
beatmap = new TestWorkingBeatmap(b);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Beatmap b = new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects = objects,
|
||||||
|
BeatmapInfo = new BeatmapInfo
|
||||||
|
{
|
||||||
|
Difficulty = new BeatmapDifficulty(),
|
||||||
|
Ruleset = rulesets.Query<RulesetInfo>().First(),
|
||||||
|
Metadata = new BeatmapMetadata
|
||||||
|
{
|
||||||
|
Artist = @"Unknown",
|
||||||
|
Title = @"Sample Beatmap",
|
||||||
|
Author = @"peppy",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
beatmap = new TestWorkingBeatmap(b);
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Framework.Graphics.Axes.Both,
|
RelativeSizeAxes = Framework.Graphics.Axes.Both,
|
||||||
|
@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private ExampleContainer container;
|
private ExampleContainer container;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseReplaySettingsOverlay()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new ReplaySettingsOverlay()
|
Add(new ReplaySettingsOverlay()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
|
@ -28,9 +28,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private WorkingBeatmap beatmap;
|
private WorkingBeatmap beatmap;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (beatmap == null)
|
if (beatmap == null)
|
||||||
{
|
{
|
||||||
@ -39,8 +39,6 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
beatmap = db.GetWorkingBeatmap(beatmapInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new Results(new Score
|
Add(new Results(new Score
|
||||||
{
|
{
|
||||||
TotalScore = 2845370,
|
TotalScore = 2845370,
|
||||||
|
@ -17,9 +17,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private RulesetDatabase rulesets;
|
private RulesetDatabase rulesets;
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
var room = new Room
|
var room = new Room
|
||||||
{
|
{
|
||||||
|
@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests multiple counters";
|
public override string Description => @"Tests multiple counters";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseScoreCounter()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
int numerator = 0, denominator = 0;
|
int numerator = 0, denominator = 0;
|
||||||
|
|
||||||
ScoreCounter score = new ScoreCounter(7)
|
ScoreCounter score = new ScoreCounter(7)
|
||||||
|
@ -28,10 +28,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private OsuSpriteText bottomLabel;
|
private OsuSpriteText bottomLabel;
|
||||||
private SpriteText topTime, bottomTime;
|
private SpriteText topTime, bottomTime;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseScrollingHitObjects()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
timeRangeBindable = new BindableDouble(2000)
|
timeRangeBindable = new BindableDouble(2000)
|
||||||
{
|
{
|
||||||
MinValue = 200,
|
MinValue = 200,
|
||||||
|
@ -12,11 +12,14 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private SettingsOverlay settings;
|
private SettingsOverlay settings;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSettings()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Children = new[] { settings = new SettingsOverlay() };
|
Children = new[] { settings = new SettingsOverlay() };
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
settings.ToggleVisibility();
|
settings.ToggleVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,10 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Skip skip skippediskip";
|
public override string Description => @"Skip skip skippediskip";
|
||||||
|
|
||||||
public override void Reset()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.LoadComplete();
|
||||||
|
|
||||||
Add(new SkipButton(Clock.CurrentTime + 5000));
|
Add(new SkipButton(Clock.CurrentTime + 5000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"social browser overlay";
|
public override string Description => @"social browser overlay";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSocial()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
SocialOverlay s = new SocialOverlay
|
SocialOverlay s = new SocialOverlay
|
||||||
{
|
{
|
||||||
Users = new[]
|
Users = new[]
|
||||||
|
@ -20,10 +20,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private StopwatchClock clock;
|
private StopwatchClock clock;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseSongProgress()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
clock = new StopwatchClock(true);
|
clock = new StopwatchClock(true);
|
||||||
|
|
||||||
Add(progress = new SongProgress
|
Add(progress = new SongProgress
|
||||||
|
@ -14,10 +14,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Filter for song select";
|
public override string Description => @"Filter for song select";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTabControl()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
OsuSpriteText text;
|
OsuSpriteText text;
|
||||||
OsuTabControl<GroupMode> filter;
|
OsuTabControl<GroupMode> filter;
|
||||||
Add(filter = new OsuTabControl<GroupMode>
|
Add(filter = new OsuTabControl<GroupMode>
|
||||||
|
@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
private bool kiai;
|
private bool kiai;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTaikoHitObjects()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
AddToggleStep("Kiai", b =>
|
AddToggleStep("Kiai", b =>
|
||||||
{
|
{
|
||||||
kiai = !kiai;
|
kiai = !kiai;
|
||||||
|
@ -29,10 +29,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
private TaikoPlayfield playfield;
|
private TaikoPlayfield playfield;
|
||||||
private Container playfieldContainer;
|
private Container playfieldContainer;
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTaikoPlayfield()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
AddStep("Hit!", addHitJudgement);
|
AddStep("Hit!", addHitJudgement);
|
||||||
AddStep("Miss :(", addMissJudgement);
|
AddStep("Miss :(", addMissJudgement);
|
||||||
AddStep("DrumRoll", () => addDrumRoll(false));
|
AddStep("DrumRoll", () => addDrumRoll(false));
|
||||||
|
@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Tests display of icons";
|
public override string Description => @"Tests display of icons";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTextAwesome()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
FillFlowContainer flow;
|
FillFlowContainer flow;
|
||||||
|
|
||||||
Add(flow = new FillFlowContainer
|
Add(flow = new FillFlowContainer
|
||||||
|
@ -10,10 +10,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Mostly back button";
|
public override string Description => @"Mostly back button";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseTwoLayerButton()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
Add(new BackButton());
|
Add(new BackButton());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
public override string Description => @"Panels for displaying a user's status";
|
public override string Description => @"Panels for displaying a user's status";
|
||||||
|
|
||||||
public override void Reset()
|
public TestCaseUserPanel()
|
||||||
{
|
{
|
||||||
base.Reset();
|
|
||||||
|
|
||||||
UserPanel flyte;
|
UserPanel flyte;
|
||||||
UserPanel peppy;
|
UserPanel peppy;
|
||||||
Add(new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
|
@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
// Check if the beatmap can be converted
|
// Check if the beatmap can be converted
|
||||||
if (!converter.CanConvert(beatmap.Beatmap))
|
if (!converter.CanConvert(beatmap.Beatmap))
|
||||||
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can't be converted for the current ruleset.");
|
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can not be converted for the current ruleset (converter: {converter}).");
|
||||||
|
|
||||||
// Convert the beatmap
|
// Convert the beatmap
|
||||||
Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset);
|
Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset);
|
||||||
|
@ -17,8 +17,12 @@ namespace osu.Game.Screens.Play
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
objects = value;
|
objects = value;
|
||||||
|
|
||||||
const int granularity = 200;
|
const int granularity = 200;
|
||||||
|
Values = new int[granularity];
|
||||||
|
|
||||||
|
if (!objects.Any())
|
||||||
|
return;
|
||||||
|
|
||||||
var firstHit = objects.First().StartTime;
|
var firstHit = objects.First().StartTime;
|
||||||
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
|
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
|
||||||
@ -28,8 +32,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
var interval = (lastHit - firstHit + 1) / granularity;
|
var interval = (lastHit - firstHit + 1) / granularity;
|
||||||
|
|
||||||
var values = new int[granularity];
|
|
||||||
|
|
||||||
foreach (var h in objects)
|
foreach (var h in objects)
|
||||||
{
|
{
|
||||||
IHasEndTime end = h as IHasEndTime;
|
IHasEndTime end = h as IHasEndTime;
|
||||||
@ -37,10 +39,8 @@ namespace osu.Game.Screens.Play
|
|||||||
int startRange = (int)((h.StartTime - firstHit) / interval);
|
int startRange = (int)((h.StartTime - firstHit) / interval);
|
||||||
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
|
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
|
||||||
for (int i = startRange; i <= endRange; i++)
|
for (int i = startRange; i <= endRange; i++)
|
||||||
values[i]++;
|
Values[i]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Values = values;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,10 +281,13 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
database.BeatmapSetAdded -= onBeatmapSetAdded;
|
if (database != null)
|
||||||
database.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
{
|
||||||
|
database.BeatmapSetAdded -= onBeatmapSetAdded;
|
||||||
|
database.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
||||||
|
}
|
||||||
|
|
||||||
initialAddSetsTask.Cancel();
|
initialAddSetsTask?.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeBackground(WorkingBeatmap beatmap)
|
private void changeBackground(WorkingBeatmap beatmap)
|
||||||
|
Loading…
Reference in New Issue
Block a user