Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <title>Tests that unsupported markup is properly ignored.</title> |
| 3 <head> | 3 <script src="track-helpers.js"></script> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | |
| 6 <script> | |
| 7 check_cues_from_track("captions-webvtt/tc028-unsupported-markup.vtt", function(t rack) { | |
| 8 var expected = [ | |
| 9 { | |
| 10 innerHTML: "Bear is Coming!!!!!\nAnd what kind of a bear it is - jus t have look.", | |
| 11 text: "<h1>Bear is Coming!!!!!</h1>\n<p>And what kind of a bear it i s - just have <a href=\"webpage.html\">look</a>.</p>" | |
| 12 }, | |
| 13 { | |
| 14 innerHTML: "\n I said Bear is coming!!!!\n I said Bear is still co ming!!!!\n", | |
| 15 text: "<ul>\n <li>I said Bear is coming!!!!</li>\n <li>I said Bear is still coming!!!!</li>\n</ul>" | |
| 16 }, | |
| 17 { | |
| 18 innerHTML: "\n I said Bear is coming now!!!!\n \n \n", | |
| 19 text: "<ol>\n <li>I said Bear is coming now!!!!</li>\n <li><img sr c=\"bear.png\" alt=\"mighty bear\"></li>\n <li><video src=\"bear_ad.webm\" cont rols></video></li>\n</ol>" | |
| 20 } | |
| 21 ]; | |
| 5 | 22 |
| 6 <script src=../media-file.js></script> | 23 var cues = track.cues; |
| 7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 24 assert_equals(cues.length, expected.length); |
| 8 (Please avoid writing new tests using video-test.js) --> | 25 for (var i = 0; i < cues.length; i++) { |
| 9 <script src=../video-test.js></script> | 26 assert_equals(cues[i].getCueAsHTML().textContent, expected[i].innerHTML) ; |
|
Srirama
2016/06/03 14:09:29
Can this test also be written in a better way like
fs
2016/06/03 14:37:16
I think that depends on how convoluted we want to
Srirama
2016/06/03 17:54:23
Thanks, looks like there is lot of stuff that i ne
| |
| 10 <script> | 27 assert_equals(cues[i].text, expected[i].text); |
| 11 | 28 } |
| 12 function trackLoaded() | 29 }); |
| 13 { | 30 </script> |
| 14 findMediaElement(); | |
| 15 var expected = | |
| 16 { | |
| 17 length : 3, | |
| 18 tests: | |
| 19 [ | |
| 20 { | |
| 21 property : "getCueAsHTML().textContent", | |
| 22 values : ["Bear is Coming!!!!!\nAnd what kind of a b ear it is - just have look.", | |
| 23 "\n I said Bear is coming!!!!\n I said B ear is still coming!!!!\n", | |
| 24 "\n I said Bear is coming now!!!!\n \n \n"], | |
| 25 }, | |
| 26 { | |
| 27 property : "text", | |
| 28 values : ["<h1>Bear is Coming!!!!!</h1>\n<p>And what kind of a bear it is - just have <a href=\"webpage.html\">look</a>.</p>", | |
| 29 "<ul>\n <li>I said Bear is coming!!!!</li >\n <li>I said Bear is still coming!!!!</li>\n</ul>", | |
| 30 "<ol>\n <li>I said Bear is coming now!!!! </li>\n <li><img src=\"bear.png\" alt=\"mighty bear\"></li>\n <li><video src=\ "bear_ad.webm\" controls></video></li>\n</ol>"], | |
| 31 }, | |
| 32 ], | |
| 33 }; | |
| 34 testCues(0, expected); | |
| 35 | |
| 36 endTest(); | |
| 37 } | |
| 38 | |
| 39 </script> | |
| 40 </head> | |
| 41 <body> | |
| 42 <p>Tests that unsupported markup is properly ignored.</p> | |
| 43 <video> | |
| 44 <track src="captions-webvtt/tc028-unsupported-markup.vtt" onload="tr ackLoaded()" default> | |
| 45 </video> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |