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/interfaces/TextTrackCueList/getter.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/interfaces/TextTrackCueList/getter.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html new file mode 100644 index 0000000000..8056d24543 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCueList/getter.html @@ -0,0 +1,49 @@ +<!doctype html> +<title>TextTrackCueList getter</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<script> +setup(function(){ + window.video = document.createElement('video'); + window.t1 = video.addTextTrack('subtitles'); + document.body.appendChild(video); +}); +test(function(){ + var cues = t1.cues; + assert_equals(cues[0], undefined, 'cues[0] before'); + var c1 = new VTTCue(0, 1, 'text1'); + t1.addCue(c1); + assert_equals(cues[0], c1, 'cues[0]'); + assert_equals(cues[1], undefined, 'cues[1]'); + assert_equals(cues[-1], undefined, 'cues[-1]'); + t1.removeCue(c1); + assert_equals(cues[0], undefined, 'cues[0] after'); +}); +test(function(){ + var cues = t1.cues; + assert_equals(cues[0], undefined); + cues[0] = 'foo'; + assert_equals(cues[0], undefined); + var c1 = new VTTCue(0, 1, 'text1'); + t1.addCue(c1); + assert_equals(cues[0], c1); + cues[0] = 'foo'; + assert_equals(cues[0], c1); + t1.removeCue(c1); +}, document.title+', no indexed set/create'); +test(function(){ + 'use strict'; + var cues = t1.cues; + assert_equals(cues[0], undefined); + assert_throws_js(TypeError, function() { cues[0] = 'foo'; }); + assert_equals(cues[0], undefined); + var c1 = new VTTCue(0, 1, 'text1'); + t1.addCue(c1); + assert_equals(cues[0], c1); + assert_throws_js(TypeError, function() { cues[0] = 'foo'; }); + assert_equals(cues[0], c1); + t1.removeCue(c1); +}, document.title+', no indexed set/create (strict)'); + +</script> |