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

Unified Diff: third_party/WebKit/LayoutTests/media/controls/overlay-play-button.js

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Add comments for dependent constants 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/media/controls/overlay-play-button.js
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button.js b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button.js
new file mode 100644
index 0000000000000000000000000000000000000000..5feccd59848fc0872e2b372166d0dee05ac7b143
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button.js
@@ -0,0 +1,38 @@
+// Defined in core/html/shadow/MediaControls.cpp.
+// Minimum width is 48px.
+var NARROW_VIDEO_WIDTH = 40;
+var NORMAL_VIDEO_WIDTH = 200;
+// Minimum height is 116px.
+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