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

Side by Side Diff: LayoutTests/media/track/opera/interfaces/VTTCue/getCueAsHTML.html

Issue 72543003: Update TextTrackCue tests to use VTTCue where appropriate (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <title>TextTrackCue.getCueAsHTML()</title> 2 <title>VTTCue.getCueAsHTML()</title>
3 <script src=../../../../../resources/testharness.js></script> 3 <script src=../../../../../resources/testharness.js></script>
4 <script src=../../../../../resources/testharnessreport.js></script> 4 <script src=../../../../../resources/testharnessreport.js></script>
5 <div id=log></div> 5 <div id=log></div>
6 <script> 6 <script>
7 test(function(){ 7 test(function(){
8 var video = document.createElement('video'); 8 var video = document.createElement('video');
9 var t1 = video.addTextTrack('subtitles'); 9 var t1 = video.addTextTrack('subtitles');
10 document.body.appendChild(video); 10 document.body.appendChild(video);
11 var c1 = new TextTrackCue(0, 1, '<c></c><c.a.b></c><i></i><b></b><u></u><rub y><rt></rt></ruby><v></v><v a b></v><00:00:00.500>x\0'); 11 var c1 = new VTTCue(0, 1, '<c></c><c.a.b></c><i></i><b></b><u></u><ruby><rt> </rt></ruby><v></v><v a b></v><00:00:00.500>x\0');
12 t1.addCue(c1); 12 t1.addCue(c1);
13 window.frag = c1.getCueAsHTML(); 13 window.frag = c1.getCueAsHTML();
14 assert_equals(frag.childNodes.length, 10, 'childNodes.length'); 14 assert_equals(frag.childNodes.length, 10, 'childNodes.length');
15 assert_true(frag instanceof DocumentFragment, 'getCueAsHTML() should return DocumentFragment'); 15 assert_true(frag instanceof DocumentFragment, 'getCueAsHTML() should return DocumentFragment');
16 }, document.title+', creating the cue'); 16 }, document.title+', creating the cue');
17 test(function(){ 17 test(function(){
18 assert_equals(frag.childNodes[0].namespaceURI, 'http://www.w3.org/1999/xhtml ', 'namespaceURI'); 18 assert_equals(frag.childNodes[0].namespaceURI, 'http://www.w3.org/1999/xhtml ', 'namespaceURI');
19 assert_equals(frag.childNodes[0].localName, 'span', 'localName'); 19 assert_equals(frag.childNodes[0].localName, 'span', 'localName');
20 assert_equals(frag.childNodes[0].attributes.length, 0, 'attributes'); 20 assert_equals(frag.childNodes[0].attributes.length, 0, 'attributes');
21 assert_false(frag.childNodes[0].hasChildNodes(), 'hasChildNodes()'); 21 assert_false(frag.childNodes[0].hasChildNodes(), 'hasChildNodes()');
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 test(function(){ 83 test(function(){
84 assert_equals(frag.childNodes[8].target, 'timestamp', 'target'); 84 assert_equals(frag.childNodes[8].target, 'timestamp', 'target');
85 assert_equals(frag.childNodes[8].data, '00:00:00.500', 'data'); 85 assert_equals(frag.childNodes[8].data, '00:00:00.500', 'data');
86 assert_true(frag.childNodes[8] instanceof ProcessingInstruction, 'instanceof '); 86 assert_true(frag.childNodes[8] instanceof ProcessingInstruction, 'instanceof ');
87 }, document.title+', <00:00:00.500>'); 87 }, document.title+', <00:00:00.500>');
88 test(function(){ 88 test(function(){
89 assert_equals(frag.childNodes[9].data, 'x\0', 'data'); 89 assert_equals(frag.childNodes[9].data, 'x\0', 'data');
90 assert_true(frag.childNodes[9] instanceof Text, 'instanceof'); 90 assert_true(frag.childNodes[9] instanceof Text, 'instanceof');
91 }, document.title+', x\\0'); 91 }, document.title+', x\\0');
92 </script> 92 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698