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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html

Issue 1938533002: Convert track-language* and track-large* 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-large-timestamp.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
index c32e1a6691404ff6dd8320d0be6e0a098fb3901b..81f8be9d0eefb1e200e21bf8d574f700df80d964 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-large-timestamp.html
@@ -1,33 +1,20 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <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 loaded()
- {
- track = document.getElementsByTagName("track")[0];
- testExpected("track.track.cues.length", 1);
- cue = testTrack.track.cues[0];
- testExpected("cue.id", 1);
- testExpected("cue.startTime / 60 / 60", 1234567);
- testExpected("cue.endTime / 60 / 60", 1234567890);
- consoleWrite("");
-
- endTest();
- }
-
- </script>
- </head>
- <body>
- <video controls>
- <track id="testTrack" src="captions-webvtt/large-timestamp.vtt" onload="loaded()" default>
- </video>
- <p>Tests that a very large timestamp is parsed correctly.</p>
- </body>
-</html>
+<title>Tests that a very large timestamp is parsed correctly.</title>
+<script src="../media-file.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<video>
+ <track src="captions-webvtt/large-timestamp.vtt" default>
+</video>
+<script>
+async_test(function(t) {
+ var testTrack = document.querySelector("track");
+ testTrack.onload = t.step_func_done(function() {
+ assert_equals(testTrack.track.cues.length, 1);
+ var cue = testTrack.track.cues[0];
+ assert_equals(parseInt(cue.id), 1);
+ assert_equals(cue.startTime / 3600, 1234567);
+ assert_equals(cue.endTime / 3600, 1234567890);
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698