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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-webvtt-tc002-bom.html

Issue 1956213002: Convert track-webvtt-tc[000-002] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698