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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Fix compile warning for uninitialized variable Created 3 years, 9 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
OLDNEW
(Empty)
1 // Defined in core/html/shadow/MediaControls.cpp.
2 // Minimum width is 48px on both desktop and Android.
mlamouri (slow - plz ping) 2017/03/08 19:13:04 Isn't this actually define in css?
steimel 2017/03/09 16:42:24 Well, the width (and height) of the play button is
3 var NARROW_VIDEO_WIDTH = 40;
4 var NORMAL_VIDEO_WIDTH = 200;
5 // 116px for android, 100px for desktop.
6 var NARROW_VIDEO_HEIGHT = 90;
7 var NORMAL_VIDEO_HEIGHT = 200;
8
9 function assertOverlayPlayButtonVisible(videoElement) {
10 assert_true(isVisible(overlayPlayButton(videoElement)),
11 "overlay play button should be visible");
12 }
13
14 function assertOverlayPlayButtonNotVisible(videoElement) {
15 assert_false(isVisible(overlayPlayButton(videoElement)),
16 "overlay play button should not be visible");
17 }
18
19 function overlayPlayButton(videoElement) {
20 var controlID = '-webkit-media-controls-overlay-play-button';
21 var button = mediaControlsElement(
22 window.internals.shadowRoot(videoElement).firstChild,
23 controlID);
24 if (!button)
25 throw 'Failed to find overlay play button';
26 return button;
27 }
28
29 function enableOverlayPlayButtonForTest(t) {
30 var mediaControlsOverlayPlayButtonValue =
31 internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled;
32 internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled = true;
33
34 t.add_cleanup(() => {
35 internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled =
36 mediaControlsOverlayPlayButtonValue;
37 });
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698