OLD | NEW |
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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/common/accelerators/accelerator_table.h" | 7 #include "ash/common/accelerators/accelerator_table.h" |
8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 void SetKeyboardBrightnessControlDelegate( | 271 void SetKeyboardBrightnessControlDelegate( |
272 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) { | 272 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) { |
273 WmShell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate); | 273 WmShell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate); |
274 } | 274 } |
275 | 275 |
276 private: | 276 private: |
277 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest); | 277 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest); |
278 }; | 278 }; |
279 | 279 |
280 AcceleratorController* AcceleratorControllerTest::GetController() { | 280 AcceleratorController* AcceleratorControllerTest::GetController() { |
281 return WmShell::Get()->accelerator_controller(); | 281 return Shell::Get()->accelerator_controller(); |
282 } | 282 } |
283 | 283 |
284 // Double press of exit shortcut => exiting | 284 // Double press of exit shortcut => exiting |
285 TEST_F(AcceleratorControllerTest, ExitWarningHandlerTestDoublePress) { | 285 TEST_F(AcceleratorControllerTest, ExitWarningHandlerTestDoublePress) { |
286 ui::Accelerator press(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); | 286 ui::Accelerator press(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); |
287 ui::Accelerator release(press); | 287 ui::Accelerator release(press); |
288 release.set_key_state(ui::Accelerator::KeyState::RELEASED); | 288 release.set_key_state(ui::Accelerator::KeyState::RELEASED); |
289 ExitWarningHandler* ewh = GetController()->GetExitWarningHandlerForTest(); | 289 ExitWarningHandler* ewh = GetController()->GetExitWarningHandlerForTest(); |
290 ASSERT_TRUE(ewh); | 290 ASSERT_TRUE(ewh); |
291 StubForTest(ewh); | 291 StubForTest(ewh); |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 // Expect no notifications from the new accelerators. | 1565 // Expect no notifications from the new accelerators. |
1566 EXPECT_TRUE(IsMessageCenterEmpty()); | 1566 EXPECT_TRUE(IsMessageCenterEmpty()); |
1567 | 1567 |
1568 // If the action is LOCK_SCREEN, we must reset the state by unlocking the | 1568 // If the action is LOCK_SCREEN, we must reset the state by unlocking the |
1569 // screen before we proceed testing the rest of accelerators. | 1569 // screen before we proceed testing the rest of accelerators. |
1570 ResetStateIfNeeded(); | 1570 ResetStateIfNeeded(); |
1571 } | 1571 } |
1572 } | 1572 } |
1573 | 1573 |
1574 } // namespace ash | 1574 } // namespace ash |
OLD | NEW |