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> |