Index: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html |
index e17de308b67a0107347e764a87ec495fc88391f1..ced7e4862682447e9e99cb576558a3ed32eb4612 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html |
@@ -1,50 +1,34 @@ |
<!DOCTYPE html> |
-<html> |
- <head> |
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
+<title>Tests that the parser properly ignores a UTF-8 BOM character at the beginning of a file and all other cues are properly parsed.</title> |
+<script src="track-helpers.js"></script> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<video> |
+ <track src="captions-webvtt/tc002-bom.vtt" default> |
+</video> |
+<script> |
+async_test(function(t) { |
+ var track = document.querySelector("track"); |
- <script src=../media-file.js></script> |
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
- <script src=../video-test.js></script> |
- <script> |
- |
- function trackLoaded() |
+ track.onload = t.step_func_done(function() { |
+ var expected = [ |
{ |
- findMediaElement(); |
- var expected = |
- { |
- length : 2, |
- tests: |
- [ |
- { |
- property : "id", |
- values : [1, 2], |
- }, |
- { |
- property : "startTime", |
- values : [0.0, 31.0], |
- }, |
- { |
- property : "endTime", |
- values : [30.5, 1200.5], |
- }, |
- { |
- property : "text", |
- values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!"], |
- }, |
- ], |
- }; |
- testCues(0, expected); |
- |
- endTest(); |
+ id : "1", |
+ startTime : 0, |
+ endTime : 30.5, |
+ text : "Bear is Coming!!!!!" |
+ }, |
+ { |
+ id : "2", |
+ startTime : 31, |
+ endTime : 1200.5, |
+ text : "I said Bear is coming!!!!" |
} |
- </script> |
- </head> |
- <body> |
- <p>Tests that the parser properly ignores a UTF-8 BOM character at the beginning of a file and all other cues are properly parsed.</p> |
- <video> |
- <track src="captions-webvtt/tc002-bom.vtt" onload="trackLoaded()" default> |
- </video> |
- </body> |
-</html> |
+ ]; |
+ |
+ var cues = track.track.cues; |
+ assert_equals(cues.length, 2); |
+ assert_cues_equal(cues, expected); |
+ }); |
+}); |
+</script> |