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

Unified Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 2720913003: Calls display_configuration_controller to rotate screen in accelerator_controller_delegate_aura (Closed)
Patch Set: Calls display_configuration_controller to rotate screen in accelerator_controller_delegate_aura Created 3 years, 10 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
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..bbf4491427c4d8c1bc7a935f4df13cd740cef16f 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -527,6 +527,24 @@ TEST_F(AcceleratorControllerTest, WindowSnapWithoutDocking) {
EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString());
}
+TEST_F(AcceleratorControllerTest, RotateScreen) {
bruthig 2017/02/28 22:49:22 Very nice test!
+ if (WmShell::Get()->IsRunningInMash())
+ return;
+
+ display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
+ 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| is determined by the AcceleratorControllerDelegate.
+ EXPECT_NE(initial_rotation, new_rotation);
+}
+
// Test class used for testing docked windows.
class EnabledDockedWindowsAcceleratorControllerTest
: public AcceleratorControllerTest {

Powered by Google App Engine
This is Rietveld 408576698