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

Unified Diff: third_party/WebKit/LayoutTests/media/video-play-pause-exception.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
Index: third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
diff --git a/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html b/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
index e88ad5e54bcf87fb2abe37ce744b480660806320..bb495fa0e81d3ce1c56b3f496d808dd0e1f02ec0 100644
--- a/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
+++ b/third_party/WebKit/LayoutTests/media/video-play-pause-exception.html
@@ -1,30 +1,22 @@
-<html>
-<body>
-<video controls></video>
-
-<p>Video has no src. Test that the playing event is not dispatched.</p>
-
-<!-- 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 the playing event is not fired when video has no src.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
<script>
- waitForEventAndFail('playing');
-
- waitForEvent("loadstart");
- waitForEvent("timeupdate");
- waitForEvent("waiting");
+async_test(function(t) {
+ var video = document.querySelector("video");
- function onpause()
- {
- testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
- endTest();
- consoleWrite("");
- }
+ video.onplaying = t.unreached_func();
+ video.onloadstart = t.step_func(function() {});
+ video.ontimeupdate = t.step_func(function() {});
+ video.onwaiting = t.step_func(function() {});
- waitForEvent("pause", onpause);
+ video.onpause = t.step_func_done(function() {
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
+ });
- run("video.play()");
- run("video.pause()");
-</script>
-</body>
-</html>
+ video.play();
+ video.pause();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698