Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js |
| diff --git a/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..02b02db4d909dab29c5c6b0bfb555f11e27a19c0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js |
| @@ -0,0 +1,38 @@ |
| +// Defined in core/html/shadow/MediaControls.cpp. |
| +// 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
|
| +var NARROW_VIDEO_WIDTH = 40; |
| +var NORMAL_VIDEO_WIDTH = 200; |
| +// 116px for android, 100px for desktop. |
| +var NARROW_VIDEO_HEIGHT = 90; |
| +var NORMAL_VIDEO_HEIGHT = 200; |
| + |
| +function assertOverlayPlayButtonVisible(videoElement) { |
| + assert_true(isVisible(overlayPlayButton(videoElement)), |
| + "overlay play button should be visible"); |
| +} |
| + |
| +function assertOverlayPlayButtonNotVisible(videoElement) { |
| + assert_false(isVisible(overlayPlayButton(videoElement)), |
| + "overlay play button should not be visible"); |
| +} |
| + |
| +function overlayPlayButton(videoElement) { |
| + var controlID = '-webkit-media-controls-overlay-play-button'; |
| + var button = mediaControlsElement( |
| + window.internals.shadowRoot(videoElement).firstChild, |
| + controlID); |
| + if (!button) |
| + throw 'Failed to find overlay play button'; |
| + return button; |
| +} |
| + |
| +function enableOverlayPlayButtonForTest(t) { |
| + var mediaControlsOverlayPlayButtonValue = |
| + internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled; |
| + internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled = true; |
| + |
| + t.add_cleanup(() => { |
| + internals.runtimeFlags.mediaControlsOverlayPlayButtonEnabled = |
| + mediaControlsOverlayPlayButtonValue; |
| + }); |
| +} |