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-remove-track.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-remove-track.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html new file mode 100644 index 0000000000..d5695cd302 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <script src="/common/media.js"></script> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <script> + async_test(function(test) + { + var video = document.createElement("video"); + var track; + + function trackRemoved() + { + assert_equals(event.target, video.textTracks); + assert_equals(event instanceof window.TrackEvent, true); + assert_equals(event.track, track); + test.done(); + } + + var trackElement = document.createElement('track'); + video.appendChild(trackElement); + + trackElement.src = 'resources/webvtt-file.vtt'; + trackElement.track.mode = 'hidden'; + + assert_equals(video.textTracks.length, 1); + + track = video.textTracks[0]; + video.removeChild(trackElement); + video.textTracks.addEventListener("removetrack", test.step_func(trackRemoved)); + }, "Tests that the 'removetrack' event is fired when an out-of-band TextTrack is removed."); + </script> + </body> +</html> |