diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html new file mode 100644 index 0000000000..5dc54ed25b --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<title>Negative timestamps</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<video> + <track src="resources/settings.vtt" default> + <script> + async_test(function(t) { + var testTrack = document.querySelector("track"); + + testTrack.onload = t.step_func_done(function() { + var cues = testTrack.track.cues; + assert_equals(testTrack.track.cues.length, 4); + // Add cue with negative startTime. + var cue = new VTTCue(-3439332606, 3.4, "Sausage?"); + testTrack.track.addCue(cue); + assert_equals(cues.length, 5); + + // Add cue with negative startTime and negative endTime. + cue = new VTTCue(-110, -3.4, "Pepperoni?"); + testTrack.track.addCue(cue); + assert_equals(cues.length, 6); + + // Set startTime and endTime to negative values. + var testCue = cues[2]; + assert_equals(testCue.startTime, 0); + testCue.startTime = -5; + assert_equals(testCue.startTime, -5); + assert_equals(testCue.endTime, 30.5); + testCue.endTime = -3439332606; + assert_equals(testCue.endTime, -3439332606); + + // Check negative cues ordering. + testCue = cues[3]; + assert_equals(testCue.startTime, 31); + testCue.startTime = -200; + // Verify that this cue is moved to 2nd position. + assert_equals(cues[1].startTime, -200); + }); + }); + </script> +</video>
\ No newline at end of file |