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

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 2837773003: Flip the flag to enable smooth screen rotation by default. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | ash/display/display_manager_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include "ash/accelerators/accelerator_table.h" 7 #include "ash/accelerators/accelerator_table.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/ime_control_delegate.h" 11 #include "ash/ime_control_delegate.h"
12 #include "ash/public/cpp/config.h" 12 #include "ash/public/cpp/config.h"
13 #include "ash/public/cpp/shell_window_ids.h" 13 #include "ash/public/cpp/shell_window_ids.h"
14 #include "ash/session/session_controller.h" 14 #include "ash/session/session_controller.h"
15 #include "ash/shell.h" 15 #include "ash/shell.h"
16 #include "ash/shell_port.h" 16 #include "ash/shell_port.h"
17 #include "ash/system/brightness_control_delegate.h" 17 #include "ash/system/brightness_control_delegate.h"
18 #include "ash/system/keyboard_brightness_control_delegate.h" 18 #include "ash/system/keyboard_brightness_control_delegate.h"
19 #include "ash/system/tray/system_tray_delegate.h" 19 #include "ash/system/tray/system_tray_delegate.h"
20 #include "ash/test/ash_test_base.h" 20 #include "ash/test/ash_test_base.h"
21 #include "ash/test/display_configuration_controller_test_api.h"
21 #include "ash/test/lock_state_controller_test_api.h" 22 #include "ash/test/lock_state_controller_test_api.h"
22 #include "ash/test/test_screenshot_delegate.h" 23 #include "ash/test/test_screenshot_delegate.h"
23 #include "ash/test/test_session_state_animator.h" 24 #include "ash/test/test_session_state_animator.h"
24 #include "ash/wm/lock_state_controller.h" 25 #include "ash/wm/lock_state_controller.h"
25 #include "ash/wm/panels/panel_layout_manager.h" 26 #include "ash/wm/panels/panel_layout_manager.h"
26 #include "ash/wm/window_positioning_utils.h" 27 #include "ash/wm/window_positioning_utils.h"
27 #include "ash/wm/window_state.h" 28 #include "ash/wm/window_state.h"
28 #include "ash/wm/window_state_aura.h" 29 #include "ash/wm/window_state_aura.h"
29 #include "ash/wm/window_util.h" 30 #include "ash/wm/window_util.h"
30 #include "ash/wm/wm_event.h" 31 #include "ash/wm/wm_event.h"
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 EXPECT_TRUE(window_state->IsNormalStateType()); 513 EXPECT_TRUE(window_state->IsNormalStateType());
513 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); 514 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString());
514 } 515 }
515 516
516 TEST_F(AcceleratorControllerTest, RotateScreen) { 517 TEST_F(AcceleratorControllerTest, RotateScreen) {
517 // TODO: needs GetDisplayInfo http://crbug.com/622480. 518 // TODO: needs GetDisplayInfo http://crbug.com/622480.
518 if (Shell::GetAshConfig() == Config::MASH) 519 if (Shell::GetAshConfig() == Config::MASH)
519 return; 520 return;
520 521
521 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); 522 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
523 test::DisplayConfigurationControllerTestApi controller_testapi(
524 Shell::Get()->display_configuration_controller());
525 controller_testapi.SetEnableScreenRotationAnimator(display.id(), false);
526
522 display::Display::Rotation initial_rotation = 527 display::Display::Rotation initial_rotation =
523 GetActiveDisplayRotation(display.id()); 528 GetActiveDisplayRotation(display.id());
524 ui::test::EventGenerator& generator = GetEventGenerator(); 529 ui::test::EventGenerator& generator = GetEventGenerator();
525 generator.PressKey(ui::VKEY_BROWSER_REFRESH, 530 generator.PressKey(ui::VKEY_BROWSER_REFRESH,
526 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); 531 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN);
527 generator.ReleaseKey(ui::VKEY_BROWSER_REFRESH, 532 generator.ReleaseKey(ui::VKEY_BROWSER_REFRESH,
528 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); 533 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN);
529 display::Display::Rotation new_rotation = 534 display::Display::Rotation new_rotation =
530 GetActiveDisplayRotation(display.id()); 535 GetActiveDisplayRotation(display.id());
531 // |new_rotation| is determined by the AcceleratorControllerDelegate. 536 // |new_rotation| is determined by the AcceleratorControllerDelegate.
532 EXPECT_NE(initial_rotation, new_rotation); 537 EXPECT_NE(initial_rotation, new_rotation);
538 controller_testapi.SetEnableScreenRotationAnimator(display.id(), true);
533 } 539 }
534 540
535 TEST_F(AcceleratorControllerTest, AutoRepeat) { 541 TEST_F(AcceleratorControllerTest, AutoRepeat) {
536 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_CONTROL_DOWN); 542 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_CONTROL_DOWN);
537 TestTarget target_a; 543 TestTarget target_a;
538 GetController()->Register({accelerator_a}, &target_a); 544 GetController()->Register({accelerator_a}, &target_a);
539 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_CONTROL_DOWN); 545 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_CONTROL_DOWN);
540 TestTarget target_b; 546 TestTarget target_b;
541 GetController()->Register({accelerator_b}, &target_b); 547 GetController()->Register({accelerator_b}, &target_b);
542 548
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 // Expect no notifications from the new accelerators. 1368 // Expect no notifications from the new accelerators.
1363 EXPECT_TRUE(IsMessageCenterEmpty()); 1369 EXPECT_TRUE(IsMessageCenterEmpty());
1364 1370
1365 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1371 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1366 // screen before we proceed testing the rest of accelerators. 1372 // screen before we proceed testing the rest of accelerators.
1367 ResetStateIfNeeded(); 1373 ResetStateIfNeeded();
1368 } 1374 }
1369 } 1375 }
1370 1376
1371 } // namespace ash 1377 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/ash_switches.h » ('j') | ash/display/display_manager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698