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

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

Issue 2084503007: Moves WindowSelectorController onto WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_overview
Patch Set: fix mash 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/wm/gestures/overview_gesture_handler.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 7139ceebac7b4f1cf27cbf36d2cd204c135132ba..d59f3df992e1be8987b5112f7e6e793a6bde83ba 100644
--- a/ash/system/overview/overview_button_tray_unittest.cc
+++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -98,8 +98,7 @@ TEST_F(OverviewButtonTrayTest, MaximizeModeObserverOnMaximizeModeToggled) {
// Tests that activating this control brings up window selection mode.
TEST_F(OverviewButtonTrayTest, PerformAction) {
- ASSERT_FALSE(Shell::GetInstance()->window_selector_controller()->
- IsSelecting());
+ ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
// Overview Mode only works when there is a window
std::unique_ptr<aura::Window> window(
@@ -107,14 +106,12 @@ TEST_F(OverviewButtonTrayTest, PerformAction) {
ui::GestureEvent tap(0, 0, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_TAP));
GetTray()->PerformAction(tap);
- EXPECT_TRUE(Shell::GetInstance()->window_selector_controller()->
- IsSelecting());
+ EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting());
}
// Tests that tapping on the control will record the user action Tray_Overview.
TEST_F(OverviewButtonTrayTest, TrayOverviewUserAction) {
- ASSERT_FALSE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
// Tapping on the control when there are no windows (and thus the user cannot
// enter overview mode) should still record the action.
@@ -122,8 +119,7 @@ TEST_F(OverviewButtonTrayTest, TrayOverviewUserAction) {
ui::GestureEvent tap(0, 0, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_TAP));
GetTray()->PerformAction(tap);
- ASSERT_FALSE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
EXPECT_EQ(1, user_action_tester.GetActionCount(kTrayOverview));
// With one window present, tapping on the control to enter overview mode
@@ -131,15 +127,13 @@ TEST_F(OverviewButtonTrayTest, TrayOverviewUserAction) {
std::unique_ptr<aura::Window> window(
CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
GetTray()->PerformAction(tap);
- ASSERT_TRUE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ ASSERT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting());
EXPECT_EQ(2, user_action_tester.GetActionCount(kTrayOverview));
// Tapping on the control to exit overview mode should record the
// user action.
GetTray()->PerformAction(tap);
- ASSERT_FALSE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
EXPECT_EQ(3, user_action_tester.GetActionCount(kTrayOverview));
}
@@ -201,8 +195,7 @@ TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) {
// Tests that the tray only renders as active while selection is ongoing. Any
// dismissal of overview mode clears the active state.
TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) {
- ASSERT_FALSE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
ASSERT_FALSE(GetTray()->draw_background_as_active());
// Overview Mode only works when there is a window
@@ -211,13 +204,11 @@ TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) {
ui::GestureEvent tap(0, 0, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_TAP));
GetTray()->PerformAction(tap);
- EXPECT_TRUE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting());
EXPECT_TRUE(GetTray()->draw_background_as_active());
- Shell::GetInstance()->window_selector_controller()->OnSelectionEnded();
- EXPECT_FALSE(
- Shell::GetInstance()->window_selector_controller()->IsSelecting());
+ WmShell::Get()->window_selector_controller()->OnSelectionEnded();
+ EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting());
EXPECT_FALSE(GetTray()->draw_background_as_active());
}
« no previous file with comments | « ash/system/overview/overview_button_tray.cc ('k') | ash/wm/gestures/overview_gesture_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698