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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc019-cue-size.html

Issue 2029663002: Convert track-webvtt-tc[019-021] 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 cue size from settings.</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 check_cues_from_track("captions-webvtt/tc019-cue-size.vtt", function(track) {
8 var expected = [
9 { size: 100 },
10 { size: 10 },
11 { size: 0 }
12 ];
5 13
6 <script src=../media-file.js></script> 14 assert_cues_match(track.cues, expected);
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 15 });
8 (Please avoid writing new tests using video-test.js) -->
9 <script src=../video-test.js></script>
10 <script>
11 16
12 var numberOfTrackTests = 2; 17 check_cues_from_track("captions-webvtt/tc019-cue-size-bad.vtt", function(track) {
18 var expected = [
19 { size: 100 },
20 { size: 100 },
21 { size: 100 }
22 ];
13 23
14 function trackLoaded() 24 assert_cues_match(track.cues, expected);
15 { 25 });
16 numberOfTracksLoaded++; 26 </script>
17 if (numberOfTracksLoaded == numberOfTrackTests) {
18 testTrack(0);
19 testTrackError(1);
20 }
21 }
22
23 function testTrack(i)
24 {
25 findMediaElement();
26 var expected =
27 {
28 length : 3,
29 tests:
30 [
31 {
32 property : "size",
33 values : [100, 10, 0],
34 },
35 ],
36 };
37 testCues(i, expected);
38
39 allTestsEnded();
40 }
41
42 function testTrackError(i)
43 {
44 findMediaElement();
45 var expected =
46 {
47 length : 3,
48 tests:
49 [
50 {
51 property : "size",
52 values : [100, 100, 100],
53 },
54 ],
55 };
56 testCues(i, expected);
57
58 allTestsEnded();
59 }
60 </script>
61 </head>
62 <body onload="enableAllTextTracks()">
63 <p>Tests cue size from settings.</p>
64 <video>
65 <track src="captions-webvtt/tc019-cue-size.vtt" onload="trackLoaded( )">
66 <track src="captions-webvtt/tc019-cue-size-bad.vtt" onload="trackLoa ded()">
67 </video>
68 </body>
69 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698