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

Unified Diff: ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc

Issue 2017413002: ash: Fix variable names and setters in ShelfLayoutManager and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shellshelf
Patch Set: rebase Created 4 years, 7 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/maximize_mode/maximize_mode_window_manager_unittest.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
index 8564086eddc92f84d3c2913d84f72c9f498defb2..860edaaaedaa29d3f66e9926985300719777cea9 100644
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc
@@ -864,33 +864,34 @@ TEST_F(MaximizeModeWindowManagerTest, KeepFullScreenModeOn) {
CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect));
wm::WindowState* window_state = wm::GetWindowState(w1.get());
- ShelfLayoutManager* shelf =
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
+ ShelfLayoutManager* shelf_layout_manager =
Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
// Allow the shelf to hide.
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
window_state->OnWMEvent(&event);
// With full screen, the shelf should get hidden.
EXPECT_TRUE(window_state->IsFullscreen());
- EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+ EXPECT_EQ(SHELF_HIDDEN, shelf_layout_manager->visibility_state());
CreateMaximizeModeWindowManager();
// The Full screen mode should continue to be on.
EXPECT_TRUE(window_state->IsFullscreen());
EXPECT_FALSE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+ EXPECT_EQ(SHELF_HIDDEN, shelf_layout_manager->visibility_state());
// With leaving the fullscreen mode, the maximized mode should return and the
// shelf should maintain its state from before maximize mode.
window_state->OnWMEvent(&event);
EXPECT_FALSE(window_state->IsFullscreen());
EXPECT_TRUE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
// We left fullscreen mode while in maximize mode, so the window should
// remain maximized and the shelf should not change state upon exiting
@@ -898,7 +899,7 @@ TEST_F(MaximizeModeWindowManagerTest, KeepFullScreenModeOn) {
DestroyMaximizeModeWindowManager();
EXPECT_FALSE(window_state->IsFullscreen());
EXPECT_TRUE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
}
// Verifies that if a window is un-full-screened while in maximize mode,
@@ -910,11 +911,9 @@ TEST_F(MaximizeModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) {
CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect));
wm::WindowState* window_state = wm::GetWindowState(w1.get());
- ShelfLayoutManager* shelf =
- Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
-
// Allow the shelf to hide and enter full screen.
- shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(
+ SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
window_state->OnWMEvent(&event);
ASSERT_FALSE(window_state->IsMinimized());
@@ -938,7 +937,8 @@ TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) {
CreateWindow(ui::wm::WINDOW_TYPE_NORMAL, rect));
wm::WindowState* window_state = wm::GetWindowState(w1.get());
- ShelfLayoutManager* shelf =
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
msw 2016/06/01 00:53:24 nit: why cache here but inline above? consistency
James Cook 2016/06/01 15:53:07 Changed to caching as noted in previous file.
+ ShelfLayoutManager* shelf_layout_manager =
Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager();
// Allow the shelf to hide.
@@ -946,7 +946,7 @@ TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) {
EXPECT_FALSE(window_state->IsFullscreen());
EXPECT_FALSE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
CreateMaximizeModeWindowManager();
@@ -954,20 +954,20 @@ TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) {
// state.
EXPECT_FALSE(window_state->IsFullscreen());
EXPECT_TRUE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf_layout_manager->visibility_state());
// After going into fullscreen mode, the shelf should be hidden.
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN);
window_state->OnWMEvent(&event);
EXPECT_TRUE(window_state->IsFullscreen());
EXPECT_FALSE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+ EXPECT_EQ(SHELF_HIDDEN, shelf_layout_manager->visibility_state());
// With the destruction of the manager we should remain in full screen.
DestroyMaximizeModeWindowManager();
EXPECT_TRUE(window_state->IsFullscreen());
EXPECT_FALSE(window_state->IsMaximized());
- EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+ EXPECT_EQ(SHELF_HIDDEN, shelf_layout_manager->visibility_state());
}
// Check that the full screen mode will stay active when the maximize mode is

Powered by Google App Engine
This is Rietveld 408576698