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

Unified Diff: ash/wm/caption_buttons/frame_maximize_button_unittest.cc

Issue 169443005: Fix crash which occurs when a widget destroys itself as a result of ET_GESTURE_TAP_DOWN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: ash/wm/caption_buttons/frame_maximize_button_unittest.cc
diff --git a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
index 3886416c6d2a041667c38cb30830a109c81b9306..c2908c5a84e488c28fe119477997f352476e7562 100644
--- a/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
+++ b/ash/wm/caption_buttons/frame_maximize_button_unittest.cc
@@ -750,6 +750,36 @@ TEST_F(FrameMaximizeButtonTest, MaximizeSnapLeftRestore) {
EXPECT_FALSE(window_state->HasRestoreBounds());
}
+// Test hovering over the minimize button in the help bubble then tapping the
+// snap left button.
+TEST_F(FrameMaximizeButtonTest, MaximizeBubbleMouseHoverAndTouch) {
+ aura::Window* window = widget()->GetNativeWindow();
+ ash::FrameMaximizeButton* maximize_button =
+ FrameMaximizeButtonTest::maximize_button();
+ maximize_button->set_bubble_appearance_delay_ms(0);
+
+ // Move the mouse cursor over the maximize button to make the help bubble
+ // appear.
+ aura::test::EventGenerator generator(window->GetRootWindow());
+ generator.MoveMouseTo(maximize_button->GetBoundsInScreen().CenterPoint());
+ MaximizeBubbleController* maximizer = maximize_button->maximizer();
+ ASSERT_TRUE(maximizer);
+
+ // Move the mouse cursor over the minimize button in the help bubble.
+ gfx::Point minimize_pos = maximizer->GetButtonForUnitTest(SNAP_MINIMIZE)->
+ GetBoundsInScreen().CenterPoint();
+ generator.MoveMouseTo(minimize_pos);
+
+ // Tap the snap left button in the help bubble.
+ gfx::Point snap_pos = maximizer->GetButtonForUnitTest(SNAP_LEFT)->
+ GetBoundsInScreen().CenterPoint();
+ generator.GestureTapAt(snap_pos);
+ internal::SnapSizer sizer(wm::GetWindowState(window), gfx::Point(),
+ internal::SnapSizer::LEFT_EDGE,
+ internal::SnapSizer::OTHER_INPUT);
+ EXPECT_EQ(sizer.target_bounds().ToString(), window->bounds().ToString());
+}
+
// Test that minimizing the window per keyboard closes the maximize bubble.
TEST_F(FrameMaximizeButtonTest, MinimizePerKeyClosesBubble) {
aura::Window* window = widget()->GetNativeWindow();

Powered by Google App Engine
This is Rietveld 408576698