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

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

Issue 2120783002: Convert video-controls* 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled-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-dont-show-on-focus-when-disabled.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
index b2cc112f17a3ba0bf0972bf2ae6660ae8546b9cd..0b204f0e99f35d88492d2b4837a50817edca134c 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled.html
@@ -1,30 +1,24 @@
<!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 don't appear when the media (&lt;video>) element is
-focused and the 'controls' attribute is not set.
-</p>
-<!-- 'tabindex' makes the video focusable despite it not having controls -->
-<video tabindex="0" autoplay src="content/test.ogv"></video>
+<title>Test that video controls don't appear when the media element is focused and the "controls" attribute is not set.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-controls.js"></script>
+<script src="media-file.js"></script>
+<!-- "tabindex" makes the video focusable despite it not having controls -->
+<video tabindex="0"></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");
+ video.focus();
+ assert_equals(getComputedStyle(controls).opacity, "0");
+ }), video);
+ });
- video.focus();
- testExpected("getComputedStyle(controls).opacity", 0);
-
- endTest();
- }, video);
+ video.src = findMediaFile("video", "content/test");
+ video.play();
});
-</script>
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-controls-dont-show-on-focus-when-disabled-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698