Index: chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
index f0c54f30b181fa73546f78e8b0aa4aa40c805285..38e9950a6bc5603e2780ddc6face31e253cebf4f 100644 |
--- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
+++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
@@ -31,6 +31,12 @@ namespace { |
using DisplayUnitInfoList = DisplayInfoProvider::DisplayUnitInfoList; |
using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList; |
+void EnableMaximizeMode(bool enable) { |
+ ash::Shell::GetInstance() |
+ ->maximize_mode_controller() |
+ ->EnableMaximizeModeWindowManager(enable); |
+} |
+ |
class DisplayInfoProviderChromeosTest : public ash::test::AshTestBase { |
public: |
DisplayInfoProviderChromeosTest() {} |
@@ -921,9 +927,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) { |
EXPECT_FALSE(screen_orientation_controller->rotation_locked()); |
// Entering maximize mode enables accelerometer screen rotations. |
- ash::Shell::Get() |
- ->maximize_mode_controller() |
- ->EnableMaximizeModeWindowManager(true); |
+ EnableMaximizeMode(true); |
// Rotation lock should not activate because DisplayInfoProvider::SetInfo() |
// was called when not in maximize mode. |
EXPECT_FALSE(screen_orientation_controller->rotation_locked()); |
@@ -936,23 +940,22 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) { |
EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); |
// Exiting maximize mode should restore the initial rotation |
- ash::Shell::Get() |
- ->maximize_mode_controller() |
- ->EnableMaximizeModeWindowManager(false); |
+ EnableMaximizeMode(false); |
EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); |
} |
// Tests that rotation changes made during maximize mode lock the display |
-// against accelerometer rotations. |
+// against accelerometer rotations, and is set as user rotation locked. |
TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringMaximizeMode) { |
// Entering maximize mode enables accelerometer screen rotations. |
- ash::Shell::Get() |
- ->maximize_mode_controller() |
- ->EnableMaximizeModeWindowManager(true); |
+ EnableMaximizeMode(true); |
ASSERT_FALSE(ash::Shell::GetInstance() |
->screen_orientation_controller() |
->rotation_locked()); |
+ ASSERT_FALSE(ash::Shell::GetInstance() |
+ ->screen_orientation_controller() |
+ ->user_rotation_locked()); |
api::system_display::DisplayProperties info; |
info.rotation.reset(new int(90)); |
@@ -968,6 +971,9 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringMaximizeMode) { |
EXPECT_TRUE(ash::Shell::GetInstance() |
->screen_orientation_controller() |
->rotation_locked()); |
+ EXPECT_TRUE(ash::Shell::GetInstance() |
+ ->screen_orientation_controller() |
+ ->user_rotation_locked()); |
lazyboy
2017/04/03 20:52:34
Do we want to cleanup afterwards, i.e. EnableMaxim
Qiang(Joe) Xu
2017/04/03 21:08:08
It doesn't need the cleanup for EnableMaximizeMode
lazyboy
2017/04/03 21:23:29
Acknowledged.
if we don't force the touchview mod
|
} |
TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) { |