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

Unified Diff: ash/system/rotation/tray_rotation_lock_unittest.cc

Issue 2909763002: Revert of Rename MaximizeMode to TabletMode (Closed)
Patch Set: Created 3 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
« no previous file with comments | « ash/system/rotation/tray_rotation_lock.cc ('k') | ash/system/screen_layout_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/rotation/tray_rotation_lock_unittest.cc
diff --git a/ash/system/rotation/tray_rotation_lock_unittest.cc b/ash/system/rotation/tray_rotation_lock_unittest.cc
index 703b678400c0cd02c5237975e331966451d97ebe..4101e2508bada88b4349422efc0038d597d1ac19 100644
--- a/ash/system/rotation/tray_rotation_lock_unittest.cc
+++ b/ash/system/rotation/tray_rotation_lock_unittest.cc
@@ -14,7 +14,7 @@
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/status_area_widget_test_helper.h"
-#include "ash/wm/tablet_mode/tablet_mode_controller.h"
+#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "base/command_line.h"
#include "base/time/time.h"
#include "ui/display/display_switches.h"
@@ -114,39 +114,45 @@
EXPECT_FALSE(tray_view()->visible());
}
-// Tests that when the tray view is created, while TabletMode is active, that
-// it must be visible, and becomes invisible exiting TabletMode.
-TEST_F(TrayRotationLockTest, CreateTrayViewDuringTabletMode) {
- TearDownViews();
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+// Tests that when the tray view is created, while MaximizeMode is active, that
+// it must be visible, and becomes invisible exiting MaximizeMode.
+TEST_F(TrayRotationLockTest, CreateTrayViewDuringMaximizeMode) {
+ TearDownViews();
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget());
EXPECT_TRUE(tray_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
- EXPECT_FALSE(tray_view()->visible());
-}
-
-// Tests that the enabling of TabletMode affects a previously created tray
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
+ EXPECT_FALSE(tray_view()->visible());
+}
+
+// Tests that the enabling of MaximizeMode affects a previously created tray
// view, changing the visibility.
-TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringTabletMode) {
+TEST_F(TrayRotationLockTest, TrayViewVisibilityChangesDuringMaximizeMode) {
ASSERT_FALSE(tray_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
EXPECT_TRUE(tray_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(tray_view()->visible());
}
// Tests that when the tray view is created for a secondary display, that it is
-// not visible, and that TabletMode does not affect visibility.
+// not visible, and that MaximizeMode does not affect visibility.
TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) {
UpdateDisplay("400x400,200x200");
SetUpForStatusAreaWidget(
StatusAreaWidgetTestHelper::GetSecondaryStatusAreaWidget());
EXPECT_FALSE(tray_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
- EXPECT_FALSE(tray_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
+ EXPECT_FALSE(tray_view()->visible());
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(tray_view()->visible());
}
@@ -156,23 +162,27 @@
EXPECT_FALSE(default_view()->visible());
}
-// Tests that when the default view is created, while TabletMode is active,
+// Tests that when the default view is created, while MaximizeMode is active,
// that it is visible.
-TEST_F(TrayRotationLockTest, CreateDefaultViewDuringTabletMode) {
- TearDownViews();
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+TEST_F(TrayRotationLockTest, CreateDefaultViewDuringMaximizeMode) {
+ TearDownViews();
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
SetUpForStatusAreaWidget(StatusAreaWidgetTestHelper::GetStatusAreaWidget());
EXPECT_TRUE(default_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(default_view()->visible());
}
-// Tests that the enabling of TabletMode affects a previously created default
+// Tests that the enabling of MaximizeMode affects a previously created default
// view, changing the visibility.
-TEST_F(TrayRotationLockTest, DefaultViewVisibilityChangesDuringTabletMode) {
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+TEST_F(TrayRotationLockTest, DefaultViewVisibilityChangesDuringMaximizeMode) {
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
EXPECT_TRUE(default_view()->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
EXPECT_FALSE(default_view()->visible());
}
@@ -190,12 +200,12 @@
// Tests that activating the default view causes the display to have its
// rotation locked.
TEST_F(TrayRotationLockTest, PerformActionOnDefaultView) {
- TabletModeController* tablet_mode_controller =
- Shell::Get()->tablet_mode_controller();
+ MaximizeModeController* maximize_mode_controller =
+ Shell::Get()->maximize_mode_controller();
ScreenOrientationController* screen_orientation_controller =
Shell::Get()->screen_orientation_controller();
ASSERT_FALSE(screen_orientation_controller->rotation_locked());
- tablet_mode_controller->EnableTabletModeWindowManager(true);
+ maximize_mode_controller->EnableMaximizeModeWindowManager(true);
ASSERT_TRUE(tray_view()->visible());
ui::GestureEvent tap(0, 0, 0, base::TimeTicks(),
@@ -204,7 +214,7 @@
EXPECT_TRUE(screen_orientation_controller->rotation_locked());
EXPECT_TRUE(tray_view()->visible());
- tablet_mode_controller->EnableTabletModeWindowManager(false);
+ maximize_mode_controller->EnableMaximizeModeWindowManager(false);
}
// Tests that when the tray is created without the internal display being known,
@@ -222,18 +232,22 @@
std::unique_ptr<views::View> default_view(tray->CreateDefaultView(
StatusAreaWidgetTestHelper::GetUserLoginStatus()));
EXPECT_TRUE(default_view);
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
EXPECT_TRUE(default_view->visible());
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
}
// Tests that when the tray view is deleted, while TrayRotationLock has not been
// deleted, that updates to the rotation lock state do not crash.
TEST_F(TrayRotationLockTest, LockUpdatedDuringDesctruction) {
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
DestroyTrayView();
Shell::Get()->screen_orientation_controller()->ToggleUserRotationLock();
- Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
}
} // namespace ash
« no previous file with comments | « ash/system/rotation/tray_rotation_lock.cc ('k') | ash/system/screen_layout_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698