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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-cue-empty-crash.html

Issue 1882583002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 4 years, 8 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 having an empty cue does not crash when calling getCueAsHTML() .</title>
3 <head> 3 <script src="../../resources/testharness.js"></script>
4 <script src=../media-file.js></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 5 <script>
6 (Please avoid writing new tests using video-test.js) --> 6 test(function() {
7 <script src=../video-test.js></script> 7 var emptyCue = new VTTCue(0, 0, "");
8 <script> 8 var fragment = emptyCue.getCueAsHTML();
9 var fragment;
10 function startTest()
11 {
12 var emptyCue = new VTTCue(0, 0, "");
13 fragment = emptyCue.getCueAsHTML();
14 9
15 consoleWrite("** The getCueAsHTML() method should return a document fragment **"); 10 // The getCueAsHTML() method should return a document fragment.
16 testExpected("fragment", null, "!="); 11 assert_true(fragment instanceof DocumentFragment);
17 12
18 consoleWrite("<br>** The document fragment should have one child, an empty Text node **"); 13 // The document fragment should have one child, an empty Text node.
19 testExpected("fragment.childNodes.length", 1); 14 assert_equals(fragment.childNodes.length, 1);
20 testExpected("fragment.childNodes[0].constructor.name", Text.name); 15 assert_equals(fragment.childNodes[0].constructor.name, Text.name);
21 testExpected("fragment.childNodes[0].length", 0); 16 assert_equals(fragment.childNodes[0].length, 0);
22 17 assert_equals(fragment.childNodes[0].data, "");
23 consoleWrite(""); 18 });
24 consoleWrite("No crash. PASS."); 19 </script>
25 consoleWrite("");
26
27 endTest();
28 }
29 </script>
30 </head>
31
32 <body onload="startTest()">
33 <p>Tests that having an empty cue does not crash when calling getCueAsHT ML().</p>
34 <video controls />
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698