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

Unified Diff: ash/wm/workspace/multi_window_resize_controller_unittest.cc

Issue 753933003: Dismiss the multi window resizer when the user clicks outside of the resizer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@toplevel_consume_press
Patch Set: Created 6 years 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 | « ash/wm/workspace/multi_window_resize_controller.cc ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/multi_window_resize_controller_unittest.cc
diff --git a/ash/wm/workspace/multi_window_resize_controller_unittest.cc b/ash/wm/workspace/multi_window_resize_controller_unittest.cc
index 4672a905e0a734d129dcb0d89b62bb7ffd99ad34..d81c2bac2657ced0be5b749e9ad51b7c00480371 100644
--- a/ash/wm/workspace/multi_window_resize_controller_unittest.cc
+++ b/ash/wm/workspace/multi_window_resize_controller_unittest.cc
@@ -338,4 +338,39 @@ TEST_F(MultiWindowResizeControllerTest, Three) {
generator.PressLeftButton();
}
+// Tests that clicking outside of the resize handle dismisses it.
+TEST_F(MultiWindowResizeControllerTest, ClickOutside) {
+ aura::test::TestWindowDelegate delegate1;
+ scoped_ptr<aura::Window> w1(
+ CreateTestWindow(&delegate1, gfx::Rect(0, 0, 100, 100)));
+ delegate1.set_window_component(HTRIGHT);
+ aura::test::TestWindowDelegate delegate2;
+ scoped_ptr<aura::Window> w2(
+ CreateTestWindow(&delegate2, gfx::Rect(100, 0, 100, 100)));
+ delegate2.set_window_component(HTLEFT);
+
+ ui::test::EventGenerator& generator(GetEventGenerator());
+ gfx::Point w1_center_in_screen = w1->GetBoundsInScreen().CenterPoint();
+ generator.MoveMouseTo(w1_center_in_screen);
+ EXPECT_TRUE(HasPendingShow());
+ EXPECT_TRUE(IsShowing());
+ ShowNow();
+ EXPECT_TRUE(IsShowing());
+
+ gfx::Rect resize_widget_bounds_in_screen =
+ resize_widget()->GetWindowBoundsInScreen();
+
+ // Clicking on the resize handle should not do anything.
+ generator.MoveMouseTo(resize_widget_bounds_in_screen.CenterPoint());
+ generator.ClickLeftButton();
+ EXPECT_TRUE(IsShowing());
+
+ // Clicking outside the resize handle should immediately hide the resize
+ // handle.
+ EXPECT_FALSE(resize_widget_bounds_in_screen.Contains(w1_center_in_screen));
+ generator.MoveMouseTo(w1_center_in_screen);
+ generator.ClickLeftButton();
+ EXPECT_FALSE(IsShowing());
+}
+
} // namespace ash
« no previous file with comments | « ash/wm/workspace/multi_window_resize_controller.cc ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698