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