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

Unified Diff: third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen.html

Issue 2104823002: Convert video-prefixed* and video-preload* 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-prefixed-fullscreen-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-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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-prefixed-fullscreen-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698