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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-cue-mutable-text.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 cue text is mutable.</title> 2 <title>Test that cue text is mutable.</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 <video> 7 <video>
8 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > 8 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default >
9 </video> 9 </video>
10 <script> 10 <script>
(...skipping 17 matching lines...) Expand all
28 assert_equals(testTrack.track.cues[1].startTime, 3.0); 28 assert_equals(testTrack.track.cues[1].startTime, 3.0);
29 29
30 assert_equals(testTrack.track.cues[0].text, "Lorem ipsum dolor sit amet, "); 30 assert_equals(testTrack.track.cues[0].text, "Lorem ipsum dolor sit amet, ");
31 var fragment = document.createDocumentFragment(); 31 var fragment = document.createDocumentFragment();
32 fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet ,")); 32 fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet ,"));
33 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) ); 33 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) );
34 34
35 // Change the start time of cue #1, it should become visible. 35 // Change the start time of cue #1, it should become visible.
36 testTrack.track.cues[0].startTime = 0; 36 testTrack.track.cues[0].startTime = 0;
37 assert_equals(testTrack.track.cues[0].startTime, 0); 37 assert_equals(testTrack.track.cues[0].startTime, 0);
38 assert_equals(textTrackDisplayElement(video, "display").innerText, "Lore m ipsum dolor sit amet,"); 38 assert_equals(textTrackDisplayElement(video).innerText, "Lorem ipsum dol or sit amet,");
39 39
40 // Change the cue text, getCueAsHTML() should return a new, correct frag ment. 40 // Change the cue text, getCueAsHTML() should return a new, correct frag ment.
41 testTrack.track.cues[0].text = "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>s it</i> amet,"; 41 testTrack.track.cues[0].text = "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>s it</i> amet,";
42 assert_equals(testTrack.track.cues[0].text, "Lorem <b>ipsum</b> <u>dolor </u> <i.sit>sit</i> amet,"); 42 assert_equals(testTrack.track.cues[0].text, "Lorem <b>ipsum</b> <u>dolor </u> <i.sit>sit</i> amet,");
43 43
44 fragment = document.createDocumentFragment(); 44 fragment = document.createDocumentFragment();
45 fragment.appendChild(document.createTextNode("Lorem ")); 45 fragment.appendChild(document.createTextNode("Lorem "));
46 46
47 var bold = document.createElement("b"); 47 var bold = document.createElement("b");
48 bold.appendChild(document.createTextNode("ipsum")); 48 bold.appendChild(document.createTextNode("ipsum"));
(...skipping 15 matching lines...) Expand all
64 fragment.appendChild(document.createTextNode(" amet,")); 64 fragment.appendChild(document.createTextNode(" amet,"));
65 65
66 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) ); 66 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML()) );
67 67
68 t.done(); 68 t.done();
69 } 69 }
70 70
71 video.src = findMediaFile("video", "../content/counting"); 71 video.src = findMediaFile("video", "../content/counting");
72 }); 72 });
73 </script> 73 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698