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

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

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-narrow.html
diff --git a/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
new file mode 100644
index 0000000000000000000000000000000000000000..77e37c4ab878b2bb6e237a5ef24b419f13b530fa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/controls/overlay-play-button-narrow.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>media controls overlay play button narrow</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../media-file.js"></script>
+<script src="../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.
+ enableOverlayPlayButtonForTest(t);
+
+ var video = document.createElement('video');
+ video.src = findMediaFile("video", "../content/test");
+ video.width = NORMAL_VIDEO_WIDTH;
+ video.height = NORMAL_VIDEO_HEIGHT;
+ video.controls = true;
+ document.body.appendChild(video);
+
+ 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 = NARROW_VIDEO_WIDTH;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonNotVisible(video);
+
+ // Re-widening the video should display the button.
+ video.width = NORMAL_VIDEO_WIDTH;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonVisible(video);
+
+ // If the height goes under the minimum, the button should be hidden.
+ video.height = NARROW_VIDEO_HEIGHT;
+ testRunner.layoutAndPaintAsyncThen(t.step_func(function() {
+ assertOverlayPlayButtonNotVisible(video);
+
+ // Re-heightening the video should display the button.
+ video.height = NORMAL_VIDEO_HEIGHT;
+ testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() {
+ assertOverlayPlayButtonVisible(video);
+ }));
+ }));
+ }));
+ }));
+ });
+});
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698