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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html

Issue 1956213002: Convert track-webvtt-tc[000-002] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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 the parser properly ignores a UTF-8 BOM character at the begin ning of a file and all other cues are properly parsed.</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 <video>
7 <track src="captions-webvtt/tc002-bom.vtt" default>
8 </video>
9 <script>
10 async_test(function(t) {
11 var track = document.querySelector("track");
5 12
6 <script src=../media-file.js></script> 13 track.onload = t.step_func_done(function() {
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 14 var expected = [
8 (Please avoid writing new tests using video-test.js) --> 15 {
9 <script src=../video-test.js></script> 16 id : "1",
10 <script> 17 startTime : 0,
18 endTime : 30.5,
19 text : "Bear is Coming!!!!!"
20 },
21 {
22 id : "2",
23 startTime : 31,
24 endTime : 1200.5,
25 text : "I said Bear is coming!!!!"
26 }
27 ];
11 28
12 function trackLoaded() 29 var cues = track.track.cues;
13 { 30 assert_equals(cues.length, 2);
14 findMediaElement(); 31 assert_cues_equal(cues, expected);
15 var expected = 32 });
16 { 33 });
17 length : 2, 34 </script>
18 tests:
19 [
20 {
21 property : "id",
22 values : [1, 2],
23 },
24 {
25 property : "startTime",
26 values : [0.0, 31.0],
27 },
28 {
29 property : "endTime",
30 values : [30.5, 1200.5],
31 },
32 {
33 property : "text",
34 values : ["Bear is Coming!!!!!", "I said Bear is com ing!!!!"],
35 },
36 ],
37 };
38 testCues(0, expected);
39
40 endTest();
41 }
42 </script>
43 </head>
44 <body>
45 <p>Tests that the parser properly ignores a UTF-8 BOM character at the b eginning of a file and all other cues are properly parsed.</p>
46 <video>
47 <track src="captions-webvtt/tc002-bom.vtt" onload="trackLoaded()" de fault>
48 </video>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698