Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html |
index 5bf142983e6436f40a1e7ee80da86a15c0d3a5c6..83d1780244e536ba51c4a383bdbf75998077e232 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc029-timings-whitespace.html |
@@ -1,74 +1,25 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
+<title>Tests that "Skip whitespace" step around cue-timings separator is working correctly.</title> |
+<script src="track-helpers.js"></script> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+check_cues_from_track("captions-webvtt/tc029-timings-whitespace.vtt", function(track) { |
+ var expected = [ |
+ { id: "1", startTime: 0.1, endTime: 1.5, text: "Single U+0020 SPACE left of cue-timings separator" }, |
+ { id: "2", startTime: 0.1, endTime: 1.5, text: "Single U+0020 SPACE right of cue-timings separator" }, |
+ { id: "3", startTime: 0.1, endTime: 1.5, text: "Single U+0009 TAB left of cue-timings separator" }, |
+ { id: "4", startTime: 0.1, endTime: 1.5, text: "Single U+0009 TAB right of cue-timings separator" }, |
+ { id: "5", startTime: 0.1, endTime: 1.5, text: "Single U+000C FORM FEED left of cue-timings separator" }, |
+ { id: "6", startTime: 0.1, endTime: 1.5, text: "Single U+000C FORM FEED right of cue-timings separator" }, |
+ { id: "7", startTime: 0.1, endTime: 1.5, text: "Several U+0020 SPACE left of cue-timings separator" }, |
+ { id: "8", startTime: 0.1, endTime: 1.5, text: "Several U+0020 SPACE right of cue-timings separator" }, |
+ { id: "9", startTime: 0.1, endTime: 1.5, text: "Several U+0009 TAB left of cue-timings separator" }, |
+ { id: "10", startTime: 0.1, endTime: 1.5, text: "Several U+0009 TAB right of cue-timings separator" }, |
+ { id: "11", startTime: 0.1, endTime: 1.5, text: "Several U+000C FORM FEED left of cue-timings separator" }, |
+ { id: "12", startTime: 0.1, endTime: 1.5, text: "Several U+000C FORM FEED right of cue-timings separator" } |
+ ]; |
- <script src=../media-file.js></script> |
- <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
- <script src=../video-test.js></script> |
- <script> |
- |
- numberOfTrackTests = 1; |
- |
- function trackLoaded() |
- { |
- numberOfTracksLoaded++; |
- if (numberOfTracksLoaded == numberOfTrackTests) { |
- testTrack0(); |
- } |
- } |
- |
- function testTrack0() |
- { |
- findMediaElement(); |
- var expected = |
- { |
- length: 12, |
- tests: |
- [ |
- { |
- property: "id", |
- values: ["1","2","3","4","5","6","7","8","9","10","11","12"], |
- }, |
- { |
- property: "startTime", |
- 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"], |
- }, |
- { |
- property: "endTime", |
- 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"], |
- }, |
- { |
- property: "text", |
- values: |
- [ |
- 'Single U+0020 SPACE left of cue-timings separator', |
- 'Single U+0020 SPACE right of cue-timings separator', |
- 'Single U+0009 TAB left of cue-timings separator', |
- 'Single U+0009 TAB right of cue-timings separator', |
- 'Single U+000C FORM FEED left of cue-timings separator', |
- 'Single U+000C FORM FEED right of cue-timings separator', |
- 'Several U+0020 SPACE left of cue-timings separator', |
- 'Several U+0020 SPACE right of cue-timings separator', |
- 'Several U+0009 TAB left of cue-timings separator', |
- 'Several U+0009 TAB right of cue-timings separator', |
- 'Several U+000C FORM FEED left of cue-timings separator', |
- 'Several U+000C FORM FEED right of cue-timings separator', |
- ], |
- }, |
- ], |
- }; |
- testCues(0, expected); |
- |
- allTestsEnded(); |
- } |
- </script> |
- </head> |
- <body onload="enableAllTextTracks()"> |
- <p>Tests that "Skip whitespace" step around cue-timings separator is working correctly.</p> |
- <video> |
- <track src="captions-webvtt/tc029-timings-whitespace.vtt" onload="trackLoaded()"> |
- </video> |
- </body> |
-</html> |
+ assert_cues_match(track.cues, expected); |
+}); |
+</script> |