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

Unified Diff: ash/system/overview/overview_button_tray_unittest.cc

Issue 2113053003: Moves Shell::maximize_mode_controller() to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 6 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
« no previous file with comments | « ash/system/overview/overview_button_tray.cc ('k') | ash/virtual_keyboard_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/overview/overview_button_tray_unittest.cc
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc
index bd5cadae0bfa064b3cc79ceeb35ad951b5b50308..9c926b55bfa090fe73025a1c4c43f4d21fd8de69 100644
--- a/ash/system/overview/overview_button_tray_unittest.cc
+++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -87,14 +87,12 @@ TEST_F(OverviewButtonTrayTest, BasicConstruction) {
// By default the system should not have MaximizeMode enabled.
TEST_F(OverviewButtonTrayTest, MaximizeModeObserverOnMaximizeModeToggled) {
ASSERT_FALSE(GetTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
EXPECT_TRUE(GetTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(false);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(GetTray()->visible());
}
@@ -149,14 +147,12 @@ TEST_F(OverviewButtonTrayTest, DisplaysOnBothDisplays) {
UpdateDisplay("400x400,200x200");
EXPECT_FALSE(GetTray()->visible());
EXPECT_FALSE(GetSecondaryTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
EXPECT_TRUE(GetTray()->visible());
EXPECT_TRUE(GetSecondaryTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(false);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
}
// Tests if Maximize Mode is enabled before a secondary display is attached
@@ -165,22 +161,19 @@ TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) {
if (!SupportsMultipleDisplays())
return;
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
UpdateDisplay("400x400,200x200");
EXPECT_TRUE(GetSecondaryTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(false);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
}
// Tests that the tray loses visibility when a user logs out, and that it
// regains visibility when a user logs back in.
TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) {
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
SetUserLoggedIn(false);
Shell::GetInstance()->UpdateAfterLoginStatusChange(
LoginStatus::NOT_LOGGED_IN);
@@ -195,9 +188,8 @@ TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) {
SetUserAddingScreenRunning(false);
NotifySessionStateChanged();
EXPECT_TRUE(GetTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(false);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
}
// Tests that the tray only renders as active while selection is ongoing. Any
@@ -229,9 +221,8 @@ TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) {
#define MAYBE_HideAnimationAlwaysCompletes HideAnimationAlwaysCompletes
#endif
TEST_F(OverviewButtonTrayTest, MAYBE_HideAnimationAlwaysCompletes) {
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
// Long duration for hide animation, to allow it to be interrupted.
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration(
@@ -266,13 +257,11 @@ TEST_F(OverviewButtonTrayTest, VisibilityChangesForSystemModalWindow) {
ParentWindowInPrimaryRootWindow(window.get());
ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(true);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
EXPECT_TRUE(GetTray()->visible());
- Shell::GetInstance()
- ->maximize_mode_controller()
- ->EnableMaximizeModeWindowManager(false);
+ WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(GetTray()->visible());
}
« no previous file with comments | « ash/system/overview/overview_button_tray.cc ('k') | ash/virtual_keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698