Chromium Code Reviews| Index: ash/accelerators/accelerator_controller_unittest.cc |
| diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc |
| index 32025f56a382f6113b9b08dff1fe174cacd7e2bb..2923a38c8776c905a32322cd37ba23313d4f7a7a 100644 |
| --- a/ash/accelerators/accelerator_controller_unittest.cc |
| +++ b/ash/accelerators/accelerator_controller_unittest.cc |
| @@ -527,6 +527,27 @@ TEST_F(AcceleratorControllerTest, WindowSnapWithoutDocking) { |
| EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); |
| } |
| +TEST_F(AcceleratorControllerTest, RotateScreen) { |
|
afakhry
2017/02/28 02:51:53
You probably need to disable this test on mash_uni
wutao
2017/02/28 20:29:09
Done.
|
| + display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); |
| + // Will it alway return a valid primary display? |
|
bruthig
2017/02/28 19:11:46
I believe you can assume GetPrimaryDisplay() will
wutao
2017/02/28 20:29:09
Removed the check.
|
| + if (!display.is_valid()) |
| + return; |
| + |
| + display::Display::Rotation initial_rotation = |
| + GetActiveDisplayRotation(display.id()); |
| + ui::test::EventGenerator& generator = GetEventGenerator(); |
| + generator.PressKey(ui::VKEY_BROWSER_REFRESH, |
| + ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); |
| + generator.ReleaseKey(ui::VKEY_BROWSER_REFRESH, |
| + ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); |
| + display::Display::Rotation new_rotation = |
| + GetActiveDisplayRotation(display.id()); |
| + // new_rotation depends on the implementation of GetNextRotation in |
|
bruthig
2017/02/28 19:11:47
nit: replace 'new_rotation' with '|new_rotation|'
wutao
2017/02/28 20:29:09
Done.
|
| + // accelerator_controller_delegate_aura.cc and the initial rotation |
|
bruthig
2017/02/28 19:11:47
nit:
- You don't need to specifically call out the
wutao
2017/02/28 20:29:09
Done.
|
| + // The best test here is to check they are not equal. |
|
bruthig
2017/02/28 19:11:47
nit: This comment isn't necessary.
wutao
2017/02/28 20:29:09
Done.
|
| + EXPECT_NE(initial_rotation, new_rotation); |
| +} |
| + |
| // Test class used for testing docked windows. |
| class EnabledDockedWindowsAcceleratorControllerTest |
| : public AcceleratorControllerTest { |