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

Side by Side Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.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 "Skip whitespace" step around cue-timings separator is working correctly.</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/tc029-timings-whitespace.vtt", function(t rack) {
8 var expected = [
9 { id: "1", startTime: 0.1, endTime: 1.5, text: "Single U+0020 SPACE left of cue-timings separator" },
10 { id: "2", startTime: 0.1, endTime: 1.5, text: "Single U+0020 SPACE righ t of cue-timings separator" },
11 { id: "3", startTime: 0.1, endTime: 1.5, text: "Single U+0009 TAB left o f cue-timings separator" },
12 { id: "4", startTime: 0.1, endTime: 1.5, text: "Single U+0009 TAB right of cue-timings separator" },
13 { id: "5", startTime: 0.1, endTime: 1.5, text: "Single U+000C FORM FEED left of cue-timings separator" },
14 { id: "6", startTime: 0.1, endTime: 1.5, text: "Single U+000C FORM FEED right of cue-timings separator" },
15 { id: "7", startTime: 0.1, endTime: 1.5, text: "Several U+0020 SPACE lef t of cue-timings separator" },
16 { id: "8", startTime: 0.1, endTime: 1.5, text: "Several U+0020 SPACE rig ht of cue-timings separator" },
17 { id: "9", startTime: 0.1, endTime: 1.5, text: "Several U+0009 TAB left of cue-timings separator" },
18 { id: "10", startTime: 0.1, endTime: 1.5, text: "Several U+0009 TAB righ t of cue-timings separator" },
19 { id: "11", startTime: 0.1, endTime: 1.5, text: "Several U+000C FORM FEE D left of cue-timings separator" },
20 { id: "12", startTime: 0.1, endTime: 1.5, text: "Several U+000C FORM FEE D right of cue-timings separator" }
21 ];
5 22
6 <script src=../media-file.js></script> 23 assert_cues_match(track.cues, expected);
7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 24 });
8 (Please avoid writing new tests using video-test.js) --> 25 </script>
9 <script src=../video-test.js></script>
10 <script>
11
12 numberOfTrackTests = 1;
13
14 function trackLoaded()
15 {
16 numberOfTracksLoaded++;
17 if (numberOfTracksLoaded == numberOfTrackTests) {
18 testTrack0();
19 }
20 }
21
22 function testTrack0()
23 {
24 findMediaElement();
25 var expected =
26 {
27 length: 12,
28 tests:
29 [
30 {
31 property: "id",
32 values: ["1","2","3","4","5","6","7","8","9","10","1 1","12"],
33 },
34 {
35 property: "startTime",
36 values: [ "0.1","0.1","0.1","0.1","0.1","0.1","0.1", "0.1","0.1","0.1","0.1","0.1"],
37 },
38 {
39 property: "endTime",
40 values: [ "1.5","1.5","1.5","1.5","1.5","1.5","1.5", "1.5","1.5","1.5","1.5","1.5"],
41 },
42 {
43 property: "text",
44 values:
45 [
46 'Single U+0020 SPACE left of cue-timings separator ',
47 'Single U+0020 SPACE right of cue-timings separato r',
48 'Single U+0009 TAB left of cue-timings separator',
49 'Single U+0009 TAB right of cue-timings separator' ,
50 'Single U+000C FORM FEED left of cue-timings separ ator',
51 'Single U+000C FORM FEED right of cue-timings sepa rator',
52 'Several U+0020 SPACE left of cue-timings separato r',
53 'Several U+0020 SPACE right of cue-timings separat or',
54 'Several U+0009 TAB left of cue-timings separator' ,
55 'Several U+0009 TAB right of cue-timings separator ',
56 'Several U+000C FORM FEED left of cue-timings sepa rator',
57 'Several U+000C FORM FEED right of cue-timings sep arator',
58 ],
59 },
60 ],
61 };
62 testCues(0, expected);
63
64 allTestsEnded();
65 }
66 </script>
67 </head>
68 <body onload="enableAllTextTracks()">
69 <p>Tests that "Skip whitespace" step around cue-timings separator is worki ng correctly.</p>
70 <video>
71 <track src="captions-webvtt/tc029-timings-whitespace.vtt" onload="tr ackLoaded()">
72 </video>
73 </body>
74 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698