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

Unified Diff: third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html

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-document-move.html
diff --git a/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html
new file mode 100644
index 0000000000000000000000000000000000000000..0accb7511fe7c2db232016367b936a5b067e83b9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/android/media/controls/overlay-play-button-document-move.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>media controls overlay play button document move</title>
+<script src="../../../../resources/testharness.js"></script>
+<script src="../../../../resources/testharnessreport.js"></script>
+<script src="../../../../media/media-file.js"></script>
+<script src="../../../../media/media-controls.js"></script>
+<script src="overlay-play-button.js"></script>
+<body>
+<script>
+async_test(function(t) {
+ // Make sure the overlay play button is turned on, as it's typically off
+ // unless we're dealing with Android.
+ internals.settings.setMediaControlsOverlayPlayButtonEnabled(true);
+ var video = createAndMoveVideo();
+
+ video.onloadedmetadata = t.step_func(function() {
+ // Large-enough video should have an overlay play button.
+ assertOverlayPlayButtonVisible(video);
+
+ // If the width goes under the minimum, the button should be hidden.
+ video.width = MIN_VIDEO_WIDTH - 10;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonNotVisible(video);
+
+ // Re-widening the video should display the button.
+ video.width = MIN_VIDEO_WIDTH;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonVisible(video);
+
+ // If the height goes under the minimum, the button should be hidden.
+ video.height = MIN_VIDEO_HEIGHT - 10;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonNotVisible(video);
+
+ // Re-heightening the video should display the button.
+ video.height = MIN_VIDEO_HEIGHT;
+ testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() {
+ assertOverlayPlayButtonVisible(video);
+ }));
+ }));
+ }));
+ }));
+ });
+
+ function createAndMoveVideo() {
+ var doc = document.implementation.createHTMLDocument();
+ var v = doc.createElement('video');
+ v.src = findMediaFile('video', '../../../../media/content/test');
+ v.width = 200;
+ v.height = 200;
+ v.controls = true;
+ doc.body.appendChild(v);
+ doc.body.removeChild(v);
+ document.body.appendChild(v);
+ return v;
+ }
+});
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698