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: LayoutTests/media/video-controls-show-on-focus.html

Issue 302603003: Cleanup tests related to controls hiding/fading in/out (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweaks. Created 6 years, 7 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
Index: LayoutTests/media/video-controls-show-on-focus.html
diff --git a/LayoutTests/media/video-controls-show-on-focus.html b/LayoutTests/media/video-controls-show-on-focus.html
index c6a657a9d7ab12b90984888c31b3558fc9ec01e3..2503e28e9eec6642ecbef4b44bc1a09efaed781c 100644
--- a/LayoutTests/media/video-controls-show-on-focus.html
+++ b/LayoutTests/media/video-controls-show-on-focus.html
@@ -9,27 +9,25 @@ Test that video controls re-appear when the media (<video>) element is focuse
<video controls autoplay src="content/test.ogv"></video>
<script>
var controls;
-var waitingForFade = false;
-var fadeinTime = 300;
+var video = document.querySelector("video");
-document.querySelector("video").addEventListener("timeupdate", function(event)
+video.addEventListener("playing", function()
{
- var video = event.target;
- if (video.currentTime < 4 || waitingForFade)
- return;
- controls = mediaControlsButton(video, "panel");
+ runAfterControlsHidden(function()
+ {
+ controls = mediaControlsButton(video, "panel");
- testExpected("getComputedStyle(controls).opacity", 0);
+ testExpected("getComputedStyle(controls).opacity", 0);
- video.focus();
+ video.focus();
- waitingForFade = true;
- setTimeout(function() {
- testExpected("getComputedStyle(controls).opacity", 1);
+ setTimeout(function()
+ {
+ testExpected("getComputedStyle(controls).opacity", 1);
- consoleWrite("");
- endTest();
- }, fadeinTime);
+ consoleWrite("");
+ endTest();
+ }, controlsFadeInDurationMs);
+ }, video);
});
-
</script>
« no previous file with comments | « LayoutTests/media/video-controls-hide-on-move-outside-controls.html ('k') | LayoutTests/media/video-controls-toggling.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698