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

Unified Diff: third_party/WebKit/LayoutTests/media/video-pause-empty-events.html

Issue 2099083002: Convert video-pause* and video-plays* 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-pause-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-pause-empty-events.html
diff --git a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
index ba3cf88d9d10930eed9510bc2f1f187e5d51f2ce..43bec2e3e97d801cd543ff69ce8a1180f5f2fcc3 100644
--- a/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
+++ b/third_party/WebKit/LayoutTests/media/video-pause-empty-events.html
@@ -1,23 +1,26 @@
-<video controls></video>
-<p>Test that pause() from EMPTY network state triggers load()</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>
+<!DOCTYPE html>
+<title>Test that pause() from EMPTY network state triggers load().</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");
video.src = findMediaFile("video", "content/test");
- testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
- waitForEvent("loadstart");
- waitForEvent("ratechange");
- waitForEvent("waiting");
- waitForEvent("ratechange");
- waitForEvent("durationchange");
- waitForEvent("loadedmetadata");
- waitForEvent("loadeddata");
- waitForEvent("canplay");
- waitForEventAndEnd("canplaythrough");
+ video.onloadstart = t.step_func(function() {});
+ video.onratechange = t.step_func(function() {});
+ video.onwaiting = t.step_func(function() {});
+ video.onratechange = 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.oncanplaythrough = t.step_func_done();
- run("video.pause()");
- consoleWrite("SCRIPT DONE");
-</script>
+ // TODO(srirama.m): Rewrite or remove this test as settings "src" itself triggers media load.
+ video.pause();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-pause-empty-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698