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

Unified Diff: third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-hide-on-resize.html

Issue 2417003002: [MediaControl] Hide overflow menu on window resize (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-hide-on-resize.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-visibility.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-hide-on-resize.html
similarity index 63%
copy from third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-visibility.html
copy to third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-hide-on-resize.html
index 0c19c301bc27e2ace2a0ed31f829c6be450065fa..c002757e565466328dd14f3209a1f34b1952e3a2 100644
--- a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-visibility.html
+++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-hide-on-resize.html
@@ -1,5 +1,12 @@
<!DOCTYPE html>
-<title>Ensure overflow menu buttons are visible when expected.</title>
+<title>Ensure overflow menu buttons are hidden when resizing.</title>
+<style>
+ #content {
+ width: 1000px;
+ height: 1000px;
+ background-color: blue;
mlamouri (slow - plz ping) 2016/10/14 18:35:23 is changing the background-color required?
Zhiqiang Zhang (Slow) 2016/10/17 10:31:45 Done.
+ }
+</style>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-controls.js"></script>
@@ -11,6 +18,9 @@
<video controls></video>
<script>
async_test(function(t) {
+ if (window.testRunner)
+ testRunner.useUnfortunateSynchronousResizeMode();
+
// Set up video
var video = document.querySelector("video");
video.src = findMediaFile("video", "content/test");
@@ -20,25 +30,27 @@ async_test(function(t) {
// Pretend we have a cast device
internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
- video.onloadeddata = t.step_func_done(function() {
+ video.onloadeddata = t.step_func(function() {
var overflowList = getOverflowList(video);
var overflowMenu = getOverflowMenuButton(video);
- // Overflow menu button should be visible
- assert_not_equals(getComputedStyle(overflowMenu).display, "none");
-
- // Overflow list shouldn't be visible until it's clicked on
- assert_equals(getComputedStyle(overflowList).display, "none");
-
// Clicking on the overflow menu button should make the overflow list visible
var coords = elementCoordinates(overflowMenu);
clickAtCoordinates(coords[0], coords[1]);
assert_not_equals(getComputedStyle(overflowList).display, "none");
- // Click on the overflow menu button, again. Should close overflow list.
- var coords = elementCoordinates(overflowMenu);
- clickAtCoordinates(coords[0], coords[1]);
- assert_equals(getComputedStyle(overflowList).display, "none");
+ // Resizing should make the overflow list invisible
mlamouri (slow - plz ping) 2016/10/14 18:35:23 nit: s/make the overflow list invisible/hide the o
Zhiqiang Zhang (Slow) 2016/10/17 10:31:45 Done.
+ function pollForControlsHidden() {
+ if (getComputedStyle(overflowList).display === "none") {
+ t.done();
+ } else {
+ setTimeout(pollForControlsHidden, 100);
mlamouri (slow - plz ping) 2016/10/14 18:35:23 I'm a bit worried about the setTimeout. Does the f
Zhiqiang Zhang (Slow) 2016/10/14 18:39:22 I'm not sure whether MediaControlsWindowEventListe
Zhiqiang Zhang (Slow) 2016/10/17 10:31:45 Seems like it works if I just use window.onresize
+ }
+ }
+ window.onresize = function() {
+ pollForControlsHidden();
+ };
+ window.resizeTo(500, 500);
});
});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698