| Index: ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| index 64c0357824182e698e34df9c5aaa0d9cd2049587..153f758a9aae64ef84a2249074fc70e44c0ecd69 100644
|
| --- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| +++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
|
| @@ -179,6 +179,10 @@ class MaximizeModeControllerTest : public test::AshTestBase {
|
| return !!maximize_mode_controller()->event_blocker_.get();
|
| }
|
|
|
| + MaximizeModeController::ForceTabletMode forced_tablet_mode() {
|
| + return maximize_mode_controller()->force_tablet_mode_;
|
| + }
|
| +
|
| base::UserActionTester* user_action_tester() { return &user_action_tester_; }
|
|
|
| private:
|
| @@ -602,4 +606,44 @@ TEST_F(MaximizeModeControllerTest, InitializedWhileTabletModeSwitchOn) {
|
| EXPECT_TRUE(controller.IsMaximizeModeWindowManagerEnabled());
|
| }
|
|
|
| +// Verify when the force clamshell mode flag is turned on, opening the lid past
|
| +// 180 degrees or setting tablet mode to true will no turn on maximize mode.
|
| +TEST_F(MaximizeModeControllerTest, ForceClamshellModeTest) {
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
| + switches::kAshForceTabletMode, switches::kAshForceTabletModeClamshell);
|
| + maximize_mode_controller()->OnShellInitialized();
|
| + EXPECT_EQ(MaximizeModeController::ForceTabletMode::CLAMSHELL,
|
| + forced_tablet_mode());
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| +
|
| + OpenLidToAngle(300.0f);
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| + EXPECT_FALSE(AreEventsBlocked());
|
| +
|
| + SetTabletMode(true);
|
| + EXPECT_FALSE(IsMaximizeModeStarted());
|
| + EXPECT_FALSE(AreEventsBlocked());
|
| +}
|
| +
|
| +// Verify when the force touch view mode flag is turned on, maximize mode is on
|
| +// intially, and opening the lid to less than 180 degress or setting tablet mode
|
| +// to off will not turn off maximize mode.
|
| +TEST_F(MaximizeModeControllerTest, ForceTouchViewModeTest) {
|
| + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
| + switches::kAshForceTabletMode, switches::kAshForceTabletModeTouchView);
|
| + maximize_mode_controller()->OnShellInitialized();
|
| + EXPECT_EQ(MaximizeModeController::ForceTabletMode::TOUCHVIEW,
|
| + forced_tablet_mode());
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| + EXPECT_TRUE(AreEventsBlocked());
|
| +
|
| + OpenLidToAngle(30.0f);
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| + EXPECT_TRUE(AreEventsBlocked());
|
| +
|
| + SetTabletMode(false);
|
| + EXPECT_TRUE(IsMaximizeModeStarted());
|
| + EXPECT_TRUE(AreEventsBlocked());
|
| +}
|
| +
|
| } // namespace ash
|
|
|