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

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: 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..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 {

Powered by Google App Engine
This is Rietveld 408576698