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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-load-from-src-readyState.html

Issue 1934913002: Convert track-load* 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-load-from-src-readyState.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-load-from-src-readyState.html b/third_party/WebKit/LayoutTests/media/track/track-load-from-src-readyState.html
index 09f90eff2942874bb65134362511211127bc71e4..97c50c48c15a5728f3edff4e007fac625a6a0a8c 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-load-from-src-readyState.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-load-from-src-readyState.html
@@ -1,33 +1,20 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Tests the load event on HTMLTrackElement and LOADED readyState on TextTrack when src is set from JavaScript.</title>
+<video>
+ <track>
+</video>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var track = document.querySelector("track");
+ assert_equals(track.readyState, HTMLTrackElement.NONE);
- <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>
- </head>
- <body>
- <p>Tests the load event on HTMLTrackElement and LOADED readyState on TextTrack when src is set from JavaScript.</p>
- <video>
- <track id="testTrackEmpty">
- </video>
- <script>
+ track.onload = t.step_func_done(function () {
+ assert_equals(track.readyState, HTMLTrackElement.LOADED);
+ });
- function trackLoaded()
- {
- consoleWrite("EVENT(load)");
- testExpected("track.readyState", HTMLTrackElement.LOADED);
- endTest();
- }
-
- track = document.getElementById('testTrackEmpty');
- testExpected("track.readyState", HTMLTrackElement.NONE);
- track.addEventListener("load", function () { trackLoaded(); }, true);
- track.src = "captions-webvtt/tc004-webvtt-file.vtt";
- track.track.mode = "hidden";
-
- </script>
- </body>
-</html>
+ track.src = "captions-webvtt/tc004-webvtt-file.vtt";
+ track.track.mode = "hidden";
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698