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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 #include "ash/accelerators/accelerator_table.h" | 6 #include "ash/accelerators/accelerator_table.h" |
7 #include "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/ime_control_delegate.h" | 9 #include "ash/ime_control_delegate.h" |
10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 661 } |
662 #endif | 662 #endif |
663 | 663 |
664 TEST_F(AcceleratorControllerTest, GlobalAccelerators) { | 664 TEST_F(AcceleratorControllerTest, GlobalAccelerators) { |
665 // CycleBackward | 665 // CycleBackward |
666 EXPECT_TRUE(ProcessWithContext( | 666 EXPECT_TRUE(ProcessWithContext( |
667 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN))); | 667 ui::Accelerator(ui::VKEY_TAB, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN))); |
668 // CycleForward | 668 // CycleForward |
669 EXPECT_TRUE(ProcessWithContext( | 669 EXPECT_TRUE(ProcessWithContext( |
670 ui::Accelerator(ui::VKEY_TAB, ui::EF_ALT_DOWN))); | 670 ui::Accelerator(ui::VKEY_TAB, ui::EF_ALT_DOWN))); |
671 #if defined(OS_CHROMEOS) | 671 // CycleLinear |
672 // CycleBackward | |
673 EXPECT_TRUE(ProcessWithContext( | |
674 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN))); | |
675 // CycleForward | |
676 EXPECT_TRUE(ProcessWithContext( | 672 EXPECT_TRUE(ProcessWithContext( |
677 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE))); | 673 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE))); |
678 | 674 |
| 675 #if defined(OS_CHROMEOS) |
679 // Take screenshot / partial screenshot | 676 // Take screenshot / partial screenshot |
680 // True should always be returned regardless of the existence of the delegate. | 677 // True should always be returned regardless of the existence of the delegate. |
681 { | 678 { |
682 EXPECT_TRUE(ProcessWithContext( | 679 EXPECT_TRUE(ProcessWithContext( |
683 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN))); | 680 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN))); |
684 EXPECT_TRUE(ProcessWithContext( | 681 EXPECT_TRUE(ProcessWithContext( |
685 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); | 682 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); |
686 EXPECT_TRUE(ProcessWithContext( | 683 EXPECT_TRUE(ProcessWithContext( |
687 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, | 684 ui::Accelerator(ui::VKEY_MEDIA_LAUNCH_APP1, |
688 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); | 685 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 EXPECT_EQ(volume_down, delegate->last_accelerator()); | 1331 EXPECT_EQ(volume_down, delegate->last_accelerator()); |
1335 EXPECT_EQ(0, delegate->handle_volume_up_count()); | 1332 EXPECT_EQ(0, delegate->handle_volume_up_count()); |
1336 EXPECT_TRUE(ProcessWithContext(volume_up)); | 1333 EXPECT_TRUE(ProcessWithContext(volume_up)); |
1337 EXPECT_EQ(1, delegate->handle_volume_up_count()); | 1334 EXPECT_EQ(1, delegate->handle_volume_up_count()); |
1338 EXPECT_EQ(volume_up, delegate->last_accelerator()); | 1335 EXPECT_EQ(volume_up, delegate->last_accelerator()); |
1339 } | 1336 } |
1340 } | 1337 } |
1341 #endif | 1338 #endif |
1342 | 1339 |
1343 } // namespace ash | 1340 } // namespace ash |
OLD | NEW |