1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 18:29:58 +08:00

Add failing test coverage of regressing video scenario

This commit is contained in:
Dean Herbert
2025-04-03 18:02:57 +09:00
Unverified
parent 4b62ea8d74
commit a49f9be243
2 changed files with 28 additions and 0 deletions
@@ -306,6 +306,29 @@ namespace osu.Game.Tests.Beatmaps.Formats
}
}
[Test]
public void TestVideoWithCustomFadeIn()
{
var decoder = new LegacyStoryboardDecoder();
using var resStream = TestResources.OpenResource("video-custom-alpha-transform.osb");
using var stream = new LineBufferedReader(resStream);
var storyboard = decoder.Decode(stream);
Assert.Multiple(() =>
{
Assert.That(storyboard.GetLayer(@"Video").Elements, Has.Count.EqualTo(1));
Assert.That(storyboard.GetLayer(@"Video").Elements.Single(), Is.InstanceOf<StoryboardVideo>());
Assert.That(storyboard.GetLayer(@"Video").Elements.Single().StartTime, Is.EqualTo(-5678));
Assert.That(((StoryboardVideo)storyboard.GetLayer(@"Video").Elements.Single()).Commands.Alpha.Single().StartTime, Is.EqualTo(1500));
Assert.That(((StoryboardVideo)storyboard.GetLayer(@"Video").Elements.Single()).Commands.Alpha.Single().EndTime, Is.EqualTo(1600));
Assert.That(storyboard.EarliestEventTime, Is.Null);
Assert.That(storyboard.LatestEventTime, Is.Null);
});
}
[Test]
public void TestVideoAndBackgroundEventsDoNotAffectStoryboardBounds()
{
@@ -0,0 +1,5 @@
osu file format v14
[Events]
Video,-5678,"Video.avi",0,0
F,0,1500,1600,0,1