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

Unified Diff: ash/frame/caption_buttons/frame_size_button_unittest.cc

Issue 2643853003: ash: fix multiple stack-use-after-scope issues with GetPrimaryDisplay use. (Closed)
Patch Set: one more test case fixed Created 3 years, 11 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/frame/caption_buttons/frame_size_button_unittest.cc
diff --git a/ash/frame/caption_buttons/frame_size_button_unittest.cc b/ash/frame/caption_buttons/frame_size_button_unittest.cc
index a14c83d6da14d35051d397deb27a184bfaa6d856..7674b9b6920ffce91ebe35cf063c2ec80031946f 100644
--- a/ash/frame/caption_buttons/frame_size_button_unittest.cc
+++ b/ash/frame/caption_buttons/frame_size_button_unittest.cc
@@ -331,9 +331,9 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
EXPECT_EQ(CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
- const gfx::Rect& kWorkAreaBoundsInScreen =
+ const gfx::Rect work_area_bounds_in_screen =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
- generator.MoveMouseTo(kWorkAreaBoundsInScreen.bottom_left());
+ generator.MoveMouseTo(work_area_bounds_in_screen.bottom_left());
// None of the buttons should be pressed because we are really far away from
// any of the caption buttons. The minimize and close button icons should
@@ -382,9 +382,9 @@ TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) {
// Moving the mouse far away from the caption buttons and then moving it over
// the close button (snap right button) should hover the close button and
// keep the size button pressed.
- const gfx::Rect& kWorkAreaBoundsInScreen =
+ const gfx::Rect work_area_bounds_in_screen =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
- generator.MoveMouseTo(kWorkAreaBoundsInScreen.bottom_left());
+ generator.MoveMouseTo(work_area_bounds_in_screen.bottom_left());
EXPECT_TRUE(AllButtonsInNormalState());
generator.MoveMouseTo(CenterPointInScreen(close_button()));
EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->state());

Powered by Google App Engine
This is Rietveld 408576698