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

Unified Diff: third_party/WebKit/LayoutTests/media/video-load-readyState.html

Issue 2077413002: Convert video-duration*, video-error* and video-load* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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/video-load-readyState.html
diff --git a/third_party/WebKit/LayoutTests/media/video-load-readyState.html b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
index 26c0fcf6ed8c20b9f024f86744ba2bd4fa32ad3c..56b6b113e09af65c77c98561c9b44a032f7cd344 100644
--- a/third_party/WebKit/LayoutTests/media/video-load-readyState.html
+++ b/third_party/WebKit/LayoutTests/media/video-load-readyState.html
@@ -1,24 +1,24 @@
-<video controls></video>
-<script src=media-file.js></script>
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
-<script src=video-test.js></script>
+<!DOCTYPE html>
+<title>Test media element readystate value on load.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
<script>
- function testReadyState(expected, endit, op)
- {
- testExpected("video.readyState", expected, op);
- if (endit)
- endTest();
- }
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
+ video.onloadstart = t.step_func(function() {});
+ video.onloadedmetadata = t.step_func(function() {});
+ video.onloadeddata = t.step_func(function() {});
+ video.oncanplay = t.step_func(function() {});
+ video.onplay = t.unreached_func();
+ video.onplaying = t.unreached_func();
- testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
- waitForEvent("loadstart");
- waitForEvent("loadedmetadata");
- waitForEvent("loadeddata");
- waitForEvent("canplay");
- waitForEventAndFail("play");
- waitForEventAndFail("playing");
- waitForEvent("canplaythrough", function () { testReadyState(HTMLMediaElement.HAVE_ENOUGH_DATA, true ); } );
+ video.oncanplaythrough = t.step_func_done(function () {
+ assert_equals(video.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
+ });
video.src = findMediaFile("video", "content/test");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698