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/video-play-empty-events.html

Issue 2090593002: Convert video-play* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-play-empty-events-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/video-play-empty-events.html
diff --git a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
index 6f08f9bbe2e1c8c8d868ddedcc3c558facdc1658..f761aa781db5ab815dff6ffa62a15496e72f9bd0 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
@@ -1,31 +1,28 @@
-<html>
-<body>
+<!DOCTYPE html>
+<title>Test that play() from EMPTY network state triggers load() and async playing event.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<video></video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
- <video controls></video>
- <p>Test that play() from EMPTY network state triggers load() and async play event.</p>
- <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>
- <script>
- testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
+ video.onloadstart = t.step_func(function() {});
+ video.onratechange = t.step_func(function() {});
+ video.onwaiting = t.step_func(function() {});
+ video.ondurationchange = 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.step_func(function() {});
- waitForEvent("loadstart");
- waitForEvent("ratechange");
- waitForEvent("waiting");
- waitForEvent("ratechange");
- waitForEvent("durationchange");
- waitForEvent("loadedmetadata");
- waitForEvent("loadeddata");
- waitForEvent("canplay");
- waitForEvent("play");
+ video.onplaying = t.step_func_done(function () {
+ assert_false(video.paused);
+ });
- waitForEvent('playing', function () { testExpected("video.paused", false); endTest(); } );
-
- video.src = findMediaFile("video", "content/test");
- run("video.play()");
- consoleWrite("SCRIPT DONE");
- </script>
-
-</body>
-</html>
+ video.src = findMediaFile("video", "content/test");
+ video.play();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-play-empty-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698