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

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: 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..53f53c15edc42930c26b774530ab31a224d08e38 100644
--- a/ash/frame/caption_buttons/frame_size_button_unittest.cc
+++ b/ash/frame/caption_buttons/frame_size_button_unittest.cc
@@ -331,7 +331,7 @@ 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 kWorkAreaBoundsInScreen =
sky 2017/01/18 23:33:45 Generally k is reserved for values that are the sa
krasin1 2017/01/19 17:36:38 Done.
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
generator.MoveMouseTo(kWorkAreaBoundsInScreen.bottom_left());
@@ -382,7 +382,7 @@ 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 kWorkAreaBoundsInScreen =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
generator.MoveMouseTo(kWorkAreaBoundsInScreen.bottom_left());
EXPECT_TRUE(AllButtonsInNormalState());

Powered by Google App Engine
This is Rietveld 408576698