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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-cue-rendering-mode-changed.html

Issue 2268923003: Clean up textTrackDisplayElement utility function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that cues are rendered when only the track mode is changed.</title> 2 <title>Test that cues are rendered when only the track mode is changed.</title>
3 <script src="../media-file.js"></script> 3 <script src="../media-file.js"></script>
4 <script src="../media-controls.js"></script> 4 <script src="../media-controls.js"></script>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script> 7 <script>
8 async_test(function(t) { 8 async_test(function(t) {
9 var video = document.createElement('video'); 9 var video = document.createElement('video');
10 video.src = findMediaFile('video', '../content/test'); 10 video.src = findMediaFile('video', '../content/test');
(...skipping 28 matching lines...) Expand all
39 // Both cues should be active. 39 // Both cues should be active.
40 assert_equals(testTrackEnglish.activeCues.length, 1); 40 assert_equals(testTrackEnglish.activeCues.length, 1);
41 assert_equals(testTrackEnglish.activeCues[0].text, 'English'); 41 assert_equals(testTrackEnglish.activeCues[0].text, 'English');
42 42
43 assert_equals(testTrackArabic.activeCues.length, 1); 43 assert_equals(testTrackArabic.activeCues.length, 1);
44 assert_equals(testTrackArabic.activeCues[0].text, 'Arabic'); 44 assert_equals(testTrackArabic.activeCues[0].text, 'Arabic');
45 } 45 }
46 46
47 function testCueVisibility() { 47 function testCueVisibility() {
48 // Only one cue should be visible. 48 // Only one cue should be visible.
49 testCueDisplayBox = textTrackDisplayElement(video, 'display', 0); 49 testCueDisplayBox = textTrackCueElementByIndex(video, 0);
50 assert_equals(testCueDisplayBox.innerText, 'Arabic'); 50 assert_equals(testCueDisplayBox.innerText, 'Arabic');
51 assert_equals(testCueDisplayBox.nextSibling, null); 51 assert_equals(testCueDisplayBox.nextSibling, null);
52 52
53 // Set the mode of the 'English' track to showing. 53 // Set the mode of the 'English' track to showing.
54 testTrackEnglish.mode = 'showing'; 54 testTrackEnglish.mode = 'showing';
55 55
56 // Both cues shold be visible. 56 // Both cues shold be visible.
57 testCueDisplayBox = textTrackDisplayElement(video, 'display', 0); 57 testCueDisplayBox = textTrackCueElementByIndex(video, 0);
58 assert_equals(testCueDisplayBox.innerText, 'Arabic'); 58 assert_equals(testCueDisplayBox.innerText, 'Arabic');
59 59
60 testCueDisplayBox = textTrackDisplayElement(video, 'display', 1); 60 testCueDisplayBox = textTrackCueElementByIndex(video, 1);
61 assert_equals(testCueDisplayBox.innerText, 'English'); 61 assert_equals(testCueDisplayBox.innerText, 'English');
62 } 62 }
63 }); 63 });
64 </script> 64 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698