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

Unified 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 side-by-side diff with in-line comments
Download patch
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;
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698