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

Side by Side Diff: LayoutTests/media/controls-cast-overlay-slow-fade.html

Issue 1336133004: Keep overlay cast button visible long enough for user action (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Test that the overlay cast button fades at the right time (neithe r too soon nor too late).</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="media-file.js"></script>
8 <script src="media-controls.js"></script>
9 <script src="video-test.js"></script>
10 </head>
11 <body>
12 <video loop></video>
13 <script>
14 var controls;
15 var test;
16 // The cast button should be visible for at least the controlsMouseMovem entTimeout, and no more
17 // than that plus the fadeout time. Allow 500ms margin at either side.
18 var hideTimeoutLowerBound = controlsMouseMovementTimeoutMs - 500;
19 var hideTimeoutUpperBound = controlsMouseMovementTimeoutMs + controlsFad eOutDurationMs + 500;
20 function overlayCastButton(element)
21 {
22 var controlID = "-internal-media-controls-overlay-cast-button";
23 var button = mediaControlsElement(window.internals.shadowRoot(elemen t).firstChild, controlID);
24 return button;
25 }
26 function playing()
27 {
28 setTimeout(function()
philipj_slow 2015/09/21 13:19:10 These also need to be wrapped in step_func. Note t
aberent 2015/09/21 14:59:20 Done. Making 'playing' an anonymous function, and
philipj_slow 2015/09/21 15:05:13 Yep, that looks good.
29 {
30 button = overlayCastButton(video);
31 // Now should have cast button
32 style = window.getComputedStyle(button);
33 visibility = style.getPropertyValue("visibility");
34 display = style.getPropertyValue("display");
35 assert_true(((display != "none")) && (visibility == "visible"),
36 "button should exist, display = \"" + display + '\"');
37 }, hideTimeoutLowerBound);
38 setTimeout(function()
39 {
40 button = overlayCastButton(video);
41 // Cast button shoud be gone
42 style = window.getComputedStyle(button);
43 visibility = style.getPropertyValue("visibility");
44 display = style.getPropertyValue("display");
45 assert_false(((display != "none")) && (visibility == "visible"),
46 "button should not exist, display = \"" + display + '\"' );
47 test.done();
48 }, hideTimeoutUpperBound);
49 }
50
51 async_test(function(t)
52 {
53 test = t;
philipj_slow 2015/09/21 13:19:10 Each step needs to be wrapped in t.step_func, othe
aberent 2015/09/21 14:59:19 Done.
54 findMediaElement();
55 video.src = findMediaFile("video", "content/test");
56 video.addEventListener("playing", playing);
philipj_slow 2015/09/21 13:19:10 t.step_func(playing).
aberent 2015/09/21 14:59:19 Done.
57 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
58 video.play();
59 });
60 </script>
61 </body>
62 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/shadow/MediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698