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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-default-attribute.html

Issue 1925243002: Convert track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-default-attribute-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/track/track-default-attribute.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-default-attribute.html b/third_party/WebKit/LayoutTests/media/track/track-default-attribute.html
index 53600d8fa7d3398420328ea69090c7f8925468bb..1ff2ecd65d4c994cf95a2790baae83c0d4a8abff 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-default-attribute.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-default-attribute.html
@@ -1,36 +1,26 @@
<!DOCTYPE html>
-<html>
- <head>
- <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>
-
- var timer = null;
-
- function trackLoaded()
- {
- consoleWrite("EVENT(load)");
- testExpected("event.target.readyState", HTMLTrackElement.LOADED);
- testExpected("event.target.id", "default");
- testExpected("event.target.default", true);
- consoleWrite("");
-
- // End the test after a brief pause so we allow other tracks to load if they will.
- if (timer)
- clearTimeout(timer);
- timer = setTimeout(function() { endTest() }, 200);
- }
-
- </script>
- </head>
- <body>
- <p>Tests that a track with the 'default' attribute loads automatically.</p>
- <video>
- <track kind="captions" src="captions-webvtt/tc005-default-styles.vtt" onload="trackLoaded()">
- <track kind="captions" src="captions-webvtt/tc005-metadata-area.vtt" onload="trackLoaded()">
- <track default kind="captions" src="captions-webvtt/tc004-webvtt-file.vtt" onload="trackLoaded()" id="default" >
- </video>
- </body>
-</html>
+<title>Tests that a track with the "default" attribute loads automatically.</title>
+<video>
+ <track kind="captions" src="captions-webvtt/tc005-default-styles.vtt">
+ <track kind="captions" src="captions-webvtt/tc005-metadata-area.vtt">
+ <track default kind="captions" src="captions-webvtt/tc004-webvtt-file.vtt" id="default">
+</video>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var timer = null;
+ var tracks = document.querySelectorAll("track");
+ for (var track of tracks) {
+ track.onload = t.step_func(function() {
+ assert_equals(event.target.readyState, HTMLTrackElement.LOADED);
+ assert_equals(event.target.id, "default");
+ assert_true(event.target.default);
+ // End the test after a brief pause so we allow other tracks to load if they will.
+ if (timer)
+ clearTimeout(timer);
+ timer = setTimeout(function() { t.done(); }, 200);
+ });
+ }
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-default-attribute-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698