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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html

Issue 2030383002: Convert track-webvtt-tc[027-029] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 6 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 <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 // TODO(srirama.m): Rewrite the test in a better way.
8 // See https://codereview.chromium.org/2030383002/ for details.
9 check_cues_from_track("captions-webvtt/tc028-unsupported-markup.vtt", function(t rack) {
10 var expected = [
11 {
12 innerHTML: "Bear is Coming!!!!!\nAnd what kind of a bear it is - jus t have look.",
13 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>"
14 },
15 {
16 innerHTML: "\n I said Bear is coming!!!!\n I said Bear is still co ming!!!!\n",
17 text: "<ul>\n <li>I said Bear is coming!!!!</li>\n <li>I said Bear is still coming!!!!</li>\n</ul>"
18 },
19 {
20 innerHTML: "\n I said Bear is coming now!!!!\n \n \n",
21 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>"
22 }
23 ];
5 24
6 <script src=../media-file.js></script> 25 var cues = track.cues;
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 26 assert_equals(cues.length, expected.length);
8 (Please avoid writing new tests using video-test.js) --> 27 for (var i = 0; i < cues.length; i++) {
9 <script src=../video-test.js></script> 28 assert_equals(cues[i].getCueAsHTML().textContent, expected[i].innerHTML) ;
10 <script> 29 assert_equals(cues[i].text, expected[i].text);
11 30 }
12 function trackLoaded() 31 });
13 { 32 </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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698