Index: third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html |
diff --git a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html |
index 0c6eb6c149562d7efd32d49c05ce47701a92f46c..8a72eb94f96e1876f4f59871cb4fccdca3fae8ce 100644 |
--- a/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html |
+++ b/third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html |
@@ -1,60 +1,40 @@ |
-<!doctype html> |
-<html> |
- <head> |
- <title>Test the prefixed HTMLVideoElement fullscreen API</title> |
- <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> |
- function start() |
- { |
- findMediaElement(); |
- testExpected("video.webkitSupportsFullscreen", true); |
- testExpected("video.webkitDisplayingFullscreen", false); |
- video.src = findMediaFile("video", "content/test"); |
- waitForEvent("loadeddata", loadeddata); |
- } |
+<!DOCTYPE html> |
+<title>Test HTMLVideoElement's prefixed fullscreen API.</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_true(video.webkitSupportsFullscreen); |
+ assert_false(video.webkitDisplayingFullscreen); |
+ video.src = findMediaFile("video", "content/test"); |
- function loadeddata() |
- { |
- testExpected("video.webkitSupportsFullscreen", true); |
- testExpected("video.webkitDisplayingFullscreen", false); |
- run("video.webkitEnterFullscreen()"); |
- waitForEvent("webkitfullscreenerror", fullscreenerror); |
- } |
+ video.onloadeddata = t.step_func(function() { |
+ assert_true(video.webkitSupportsFullscreen); |
+ assert_false(video.webkitDisplayingFullscreen); |
+ video.webkitEnterFullscreen(); |
+ video.onwebkitfullscreenerror = t.step_func(function() { |
+ assert_true(video.webkitSupportsFullscreen); |
+ assert_false(video.webkitDisplayingFullscreen); |
- function fullscreenerror() |
- { |
- testExpected("video.webkitSupportsFullscreen", true); |
- testExpected("video.webkitDisplayingFullscreen", false); |
- document.onclick = function() |
- { |
- run("video.webkitEnterFullscreen()"); |
- waitForEventOnce("webkitfullscreenchange", fullscreenenter); |
- }; |
- eventSender.mouseDown(); |
- eventSender.mouseUp(); |
- } |
+ document.onclick = t.step_func(function() { |
+ video.webkitEnterFullscreen(); |
+ video.onwebkitfullscreenchange = t.step_func(function() { |
+ assert_true(video.webkitSupportsFullscreen); |
+ assert_true(video.webkitDisplayingFullscreen); |
+ video.webkitExitFullscreen(); |
+ video.onwebkitfullscreenchange = t.step_func_done(function() { |
+ assert_true(video.webkitSupportsFullscreen); |
+ assert_false(video.webkitDisplayingFullscreen); |
+ }); |
+ }); |
+ }); |
- function fullscreenenter() |
- { |
- testExpected("video.webkitSupportsFullscreen", true); |
- testExpected("video.webkitDisplayingFullscreen", true); |
- run("video.webkitExitFullscreen()"); |
- waitForEvent("webkitfullscreenchange", fullscreenexit); |
- } |
- |
- function fullscreenexit() |
- { |
- testExpected("video.webkitSupportsFullscreen", true); |
- testExpected("video.webkitDisplayingFullscreen", false); |
- endTest(); |
- } |
- </script> |
- </head> |
- <body onload="start()"> |
- <p>Test the prefixed HTMLVideoElement fullscreen API</p> |
- <video></video> |
- </body> |
-</html> |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ }); |
+ }); |
+}); |
+</script> |