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

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: 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
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..00cd9f8a64c6de6409b44f9a350648b028f2f990 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_equals(event.target.default, true);
mlamouri (slow - plz ping) 2016/04/29 12:39:12 assert_true()
Srirama 2016/04/29 13:17:08 Done.
+ // 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>

Powered by Google App Engine
This is Rietveld 408576698