Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html |
index 381e783ef941c9983cbe89916eb506eadbdb89f6..e74ac7d51b402a0061816945f194786bef8085c5 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc014-alignment.html |
@@ -1,71 +1,31 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
+<title>Tests cue alignment from settings.</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/tc014-alignment.vtt", testTrack); |
+check_cues_from_track("captions-webvtt/tc014-alignment-ltr.vtt", testTrack); |
- <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> |
+check_cues_from_track("captions-webvtt/tc014-alignment-bad.vtt", function(track) { |
+ var expected = [ |
+ { align: "middle" }, |
+ { align: "middle" }, |
+ { align: "middle" }, |
+ { align: "middle" } |
+ ]; |
- numberOfTrackTests = 3; |
+ assert_cues_match(track.cues, expected); |
+}); |
- function trackLoaded() |
- { |
- numberOfTracksLoaded++; |
- if (numberOfTracksLoaded == numberOfTrackTests) { |
- testTrack(0); |
- testTrack(1); |
- testTrackError(2); |
- } |
- } |
+function testTrack(track) { |
+ var expected = [ |
+ { align: "start" }, |
+ { align: "middle" }, |
+ { align: "end" }, |
+ { align: "middle" } |
+ ]; |
- function testTrack(i) |
- { |
- findMediaElement(); |
- var expected = |
- { |
- length : 4, |
- tests: |
- [ |
- { |
- property : "align", |
- values : ["start", "middle", "end", "middle"], |
- }, |
- ], |
- }; |
- testCues(i, expected); |
- |
- allTestsEnded(); |
- } |
- |
- function testTrackError(i) |
- { |
- findMediaElement(); |
- var expected = |
- { |
- length : 4, |
- tests: |
- [ |
- { |
- property : "align", |
- values : ["middle", "middle", "middle", "middle"], |
- }, |
- ], |
- }; |
- testCues(i, expected); |
- |
- allTestsEnded(); |
- } |
- </script> |
- </head> |
- <body onload="enableAllTextTracks()"> |
- <p>Tests cue alignment from settings.</p> |
- <video> |
- <track src="captions-webvtt/tc014-alignment.vtt" onload="trackLoaded()"> |
- <track src="captions-webvtt/tc014-alignment-ltr.vtt" onload="trackLoaded()"> |
- <track src="captions-webvtt/tc014-alignment-bad.vtt" onload="trackLoaded()"> |
- </video> |
- </body> |
-</html> |
+ assert_cues_match(track.cues, expected); |
+} |
+</script> |