Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html |
| diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html |
| index 70422b7797b451db6cd686b84fe969e995629a16..008f412d8114fb2c6f1515f6c42d77e97ae4e02c 100644 |
| --- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html |
| +++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html |
| @@ -1,47 +1,30 @@ |
| <!DOCTYPE html> |
| -<html> |
| - <head> |
| - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| +<title>Tests that unsupported markup is properly ignored.</title> |
| +<script src="track-helpers.js"></script> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| +check_cues_from_track("captions-webvtt/tc028-unsupported-markup.vtt", function(track) { |
| + var expected = [ |
| + { |
| + innerHTML: "Bear is Coming!!!!!\nAnd what kind of a bear it is - just have look.", |
| + text: "<h1>Bear is Coming!!!!!</h1>\n<p>And what kind of a bear it is - just have <a href=\"webpage.html\">look</a>.</p>" |
| + }, |
| + { |
| + innerHTML: "\n I said Bear is coming!!!!\n I said Bear is still coming!!!!\n", |
| + text: "<ul>\n <li>I said Bear is coming!!!!</li>\n <li>I said Bear is still coming!!!!</li>\n</ul>" |
| + }, |
| + { |
| + innerHTML: "\n I said Bear is coming now!!!!\n \n \n", |
| + text: "<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>" |
| + } |
| + ]; |
| - <script src=../media-file.js></script> |
| - <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
| - (Please avoid writing new tests using video-test.js) --> |
| - <script src=../video-test.js></script> |
| - <script> |
| - |
| - function trackLoaded() |
| - { |
| - findMediaElement(); |
| - var expected = |
| - { |
| - length : 3, |
| - tests: |
| - [ |
| - { |
| - property : "getCueAsHTML().textContent", |
| - values : ["Bear is Coming!!!!!\nAnd what kind of a bear it is - just have look.", |
| - "\n I said Bear is coming!!!!\n I said Bear is still coming!!!!\n", |
| - "\n I said Bear is coming now!!!!\n \n \n"], |
| - }, |
| - { |
| - property : "text", |
| - 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>", |
| - "<ul>\n <li>I said Bear is coming!!!!</li>\n <li>I said Bear is still coming!!!!</li>\n</ul>", |
| - "<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>"], |
| - }, |
| - ], |
| - }; |
| - testCues(0, expected); |
| - |
| - endTest(); |
| - } |
| - |
| - </script> |
| - </head> |
| - <body> |
| - <p>Tests that unsupported markup is properly ignored.</p> |
| - <video> |
| - <track src="captions-webvtt/tc028-unsupported-markup.vtt" onload="trackLoaded()" default> |
| - </video> |
| - </body> |
| -</html> |
| + var cues = track.cues; |
| + assert_equals(cues.length, expected.length); |
| + for (var i = 0; i < cues.length; i++) { |
| + 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
|
| + assert_equals(cues[i].text, expected[i].text); |
| + } |
| +}); |
| +</script> |