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

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: Create/Destroy ResizeObserver onInsert/onRemove. Add (currently broken) layout test for moving vide… Created 3 years, 10 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..ae9f03cb98374f4aad81ef5d9d7298ba4671b9ec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button.js
@@ -0,0 +1,30 @@
+// Defined in core/html/shadow/MediaControls.cpp.
+var MIN_VIDEO_WIDTH = 48;
+var MIN_VIDEO_HEIGHT = 164;
+
+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 isVisible(button) {
+ var computedStyle = getComputedStyle(button);
+ return computedStyle.display !== "none" &&
+ computedStyle.display !== "hidden" &&
+ computedStyle.visibility === "visible";
+}

Powered by Google App Engine
This is Rietveld 408576698