Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
deleted file mode 100644
index c9d98db127a33b720e74bb0decddafdebd13d8ba..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!doctype html>
-<title>TextTrack.cues</title>
-<script src=../../../../../../../../resources/testharness.js></script>
-<script src=../../../../../../../../resources/testharnessreport.js></script>
-<div id=log></div>
-<script>
-test(function(){
- var video = document.createElement('video');
- var t1 = video.addTextTrack('subtitles');
- assert_equals(t1.cues, t1.cues, 't1.cues should return same object');
- assert_not_equals(t1.cues, null, 't1.cues should not be null');
- assert_true(t1.cues instanceof TextTrackCueList, 't1.cues instanceof TextTrackCueList');
- assert_equals(t1.cues.length, 0, 't1.cues.length');
-}, document.title+', empty list');
-
-function addCue(texttrack, start, end, text, id) {
- var c = new VTTCue(start, end, text);
- c.id = id;
- texttrack.addCue(c);
- return c;
-}
-
-test(function(){
- var video = document.createElement('video');
- var t1 = video.addTextTrack('subtitles');
- var t1_cues = t1.cues;
- var c = addCue(t1, 0, 1, 'text', 'id');
- assert_equals(t1.cues, t1_cues, "t1.cues should return same object");
- assert_equals(t1.cues.length, 1, "t1.cues.length");
- var c2 = addCue(t1, 1, 2, 'text2', 'id2');
- assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after adding a second cue");
- assert_equals(t1.cues.length, 2, "t1.cues.length after adding a second cue");
- assert_equals(t1.cues[0].id, "id");
- assert_equals(t1.cues[1].id, "id2");
-}, document.title+', after addCue()');
-
-test(function(){
- var video = document.createElement('video');
- var t1 = video.addTextTrack('subtitles');
- var t1_cues = t1.cues;
- var c = addCue(t1, 0, 1, 'text', 'id');
- var c2 = addCue(t1, 1, 2, 'text2', 'id2');
- t1.mode = 'showing';
- assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'showing'");
- t1.mode = 'hidden';
- assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'hidden'");
- t1.mode = 'disabled';
- assert_equals(t1.cues, null, "t1.cues should be null when mode is 'disabled'");
- assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled'");
- assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled'");
- assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled'");
- t1.mode = 'hidden';
- assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'hidden'");
- t1.mode = 'disabled';
- assert_equals(t1.cues, null, "t1.cues should be null when mode is set to 'disabled' again");
- assert_equals(t1_cues.length, 2, "t1_cues should still be intact after setting mode to 'disabled' again");
- assert_equals(t1_cues[0].id, "id", "t1_cues first cue should still be intact after setting mode to 'disabled' again");
- assert_equals(t1_cues[1].id, "id2", "t1_cues second cue should still be intact after setting mode to 'disabled' again");
- t1.mode = 'showing';
- assert_equals(t1.cues, t1_cues, "t1.cues should return the same object after setting mode to 'disabled' and then 'showing'");
-}, document.title+', different modes');
-
-test(function(){
- var video = document.createElement('video');
- var t1 = video.addTextTrack('subtitles');
- var t1_cues = t1.cues;
- var c = addCue(t1, 0, 1, 'text', 'id');
- var c2 = addCue(t1, 1, 2, 'text2', 'id2');
- t1.mode = 'showing';
- t1.cues[1].startTime = 0; // this should change the text track cue order
- assert_equals(t1.cues[0].id, 'id2');
- assert_equals(t1.cues[1].id, 'id');
- t1.cues[0].startTime = 0.5; // this should change it back
- assert_equals(t1.cues[0].id, 'id');
- assert_equals(t1.cues[1].id, 'id2');
-}, document.title+', changing order');
-
-async_test(function(){
- var video = document.createElement('video');
- var t1 = video.addTextTrack('subtitles');
- var t1_cues = t1.cues;
- t1.mode = 'showing';
- var track = document.createElement('track');
- track['default'] = true;
- video.appendChild(track); // queues a task to "honor user preferences...", media element event task source
- var t2 = track.track;
- assert_equals(t2.cues, null, 't2.cues should be null');
- // We need to wait until the "honor user preferences..." steps have run so we invoke play()
- // which queues an event with the same task source.
- video.onplay = this.step_func(function(){
- assert_equals(t2.cues, t2.cues, 't2.cues should return same object');
- assert_not_equals(t1.cues, t2.cues, 't1.cues and t2.cues should be different objects');
- assert_not_equals(t2.cues, null, 't2.cues should not be null');
- assert_true(t2.cues instanceof TextTrackCueList, 't2.cues instanceof TextTrackCueList');
- assert_equals(t2.cues.length, 0, 't2.cues should have length 0');
- this.done();
- });
- video.play(); // queues a task to fire 'play', media element event task source
-}, document.title+', default attribute');
-</script>

Powered by Google App Engine
This is Rietveld 408576698