OLD | NEW |
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 Loading... |
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> |
OLD | NEW |