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

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: 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="../../resources/testharness.js"></script>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4 <script src="../../resources/testharnessreport.js"></script>
5 <video>
6 <track src="captions-webvtt/tc002-bom.vtt" default>
7 </video>
8 <script>
9 async_test(function(t) {
10 var track = document.querySelector("track");
5 11
6 <script src=../media-file.js></script> 12 track.onload = t.step_func_done(function() {
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 13 var idValues = ["1", "2"];
8 (Please avoid writing new tests using video-test.js) --> 14 var startTimeValues = [0, 31];
9 <script src=../video-test.js></script> 15 var endTimeValues = [30.5, 1200.5];
10 <script> 16 var textValues = ["Bear is Coming!!!!!", "I said Bear is coming!!!!"];
11 17
12 function trackLoaded() 18 var cues = track.track.cues;
13 { 19 assert_equals(cues.length, 2);
14 findMediaElement(); 20 for (var i = 0; i < cues.length; i++) {
15 var expected = 21 assert_equals(cues[i].id, idValues[i]);
16 { 22 assert_equals(cues[i].startTime, startTimeValues[i]);
17 length : 2, 23 assert_equals(cues[i].endTime, endTimeValues[i]);
18 tests: 24 assert_equals(cues[i].text, textValues[i]);
mlamouri (slow - plz ping) 2016/05/10 09:14:39 I think it would make sense to have a helper file
Srirama 2016/05/10 09:32:50 Agreed, makes sense. Even enableAllTextTracks() is
Srirama 2016/05/11 10:18:21 Done.
19 [ 25 }
20 { 26 });
21 property : "id", 27 });
22 values : [1, 2], 28 </script>
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