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

Unified Diff: third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html

Issue 2116013002: Convert video-controls* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment 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-controls-show-on-focus-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-controls-show-on-focus.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
index e6f6cd527cb3530310a45ab88276ab831cc53322..2e7f025c2950082d7d9c94836dc5bb5f2504ad88 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-show-on-focus.html
@@ -1,34 +1,27 @@
<!DOCTYPE html>
-<html>
-<title>Test visibiblity of controls when focusing of &lt;video></title>
-<!-- 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 src=media-controls.js></script>
-<p>
-Test that video controls re-appear when the media (&lt;video>) element is focused.
-</p>
-<video controls autoplay src="content/test.ogv"></video>
+<title>Test visibiblity of controls when focusing video.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<script src="media-controls.js"></script>
+<video controls autoplay></video>
<script>
-var controls;
-var video = document.querySelector("video");
+async_test(function(t) {
+ var video = document.querySelector("video");
-video.addEventListener("playing", function()
-{
- runAfterHideMediaControlsTimerFired(function()
- {
- controls = mediaControlsButton(video, "panel");
+ video.onplaying = t.step_func(function() {
+ runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
+ var controls = mediaControlsButton(video, "panel");
+ assert_equals(getComputedStyle(controls).opacity, "0");
+ video.focus();
+ assert_equals(getComputedStyle(controls).opacity, "1");
- testExpected("getComputedStyle(controls).opacity", 0);
- video.focus();
+ // We fade out when focus is lost, so the opacity is still 1
+ video.blur();
+ assert_equals(getComputedStyle(controls).opacity, "1");
+ }), video);
+ });
- testExpected("getComputedStyle(controls).opacity", 1);
-
- // We fade out when focus is lost, so the opacity is still 1
- video.blur();
- testExpected("getComputedStyle(controls).opacity", 1);
-
- endTest();
- }, video);
+ video.src = findMediaFile("video", "content/test");
});
-</script>
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-show-on-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698