| 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/caps_lock_delegate.h" | 6 #include "ash/caps_lock_delegate.h" |
| 7 #include "ash/ime_control_delegate.h" | 7 #include "ash/ime_control_delegate.h" |
| 8 #include "ash/screenshot_delegate.h" | 8 #include "ash/screenshot_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 // ToggleDesktopFullScreen (not implemented yet on Linux) | 642 // ToggleDesktopFullScreen (not implemented yet on Linux) |
| 643 EXPECT_TRUE(GetController()->Process( | 643 EXPECT_TRUE(GetController()->Process( |
| 644 ui::Accelerator(ui::VKEY_F11, ui::EF_CONTROL_DOWN))); | 644 ui::Accelerator(ui::VKEY_F11, ui::EF_CONTROL_DOWN))); |
| 645 #endif // OS_LINUX | 645 #endif // OS_LINUX |
| 646 #endif // !NDEBUG | 646 #endif // !NDEBUG |
| 647 | 647 |
| 648 // Exit | 648 // Exit |
| 649 EXPECT_TRUE(GetController()->Process( | 649 EXPECT_TRUE(GetController()->Process( |
| 650 ui::Accelerator(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); | 650 ui::Accelerator(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); |
| 651 | 651 |
| 652 // New tab |
| 653 EXPECT_TRUE(GetController()->Process( |
| 654 ui::Accelerator(ui::VKEY_T, ui::EF_SHIFT_DOWN))); |
| 655 |
| 652 // New incognito window | 656 // New incognito window |
| 653 EXPECT_TRUE(GetController()->Process( | 657 EXPECT_TRUE(GetController()->Process( |
| 654 ui::Accelerator(ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); | 658 ui::Accelerator(ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); |
| 655 | 659 |
| 656 // New window | 660 // New window |
| 657 EXPECT_TRUE(GetController()->Process( | 661 EXPECT_TRUE(GetController()->Process( |
| 658 ui::Accelerator(ui::VKEY_N, ui::EF_CONTROL_DOWN))); | 662 ui::Accelerator(ui::VKEY_N, ui::EF_CONTROL_DOWN))); |
| 659 | 663 |
| 660 #if defined(OS_CHROMEOS) | 664 #if defined(OS_CHROMEOS) |
| 661 EXPECT_TRUE(GetController()->Process( | 665 EXPECT_TRUE(GetController()->Process( |
| 662 ui::Accelerator(ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); | 666 ui::Accelerator(ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); |
| 663 #endif | 667 #endif |
| 668 |
| 669 // Restore tab |
| 670 EXPECT_TRUE(GetController()->Process( |
| 671 ui::Accelerator(ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); |
| 672 |
| 673 // Show task manager |
| 674 EXPECT_TRUE(GetController()->Process( |
| 675 ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN))); |
| 664 } | 676 } |
| 665 | 677 |
| 666 TEST_F(AcceleratorControllerTest, ImeGlobalAccelerators) { | 678 TEST_F(AcceleratorControllerTest, ImeGlobalAccelerators) { |
| 667 // Test IME shortcuts. | 679 // Test IME shortcuts. |
| 668 { | 680 { |
| 669 const ui::Accelerator control_space(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN); | 681 const ui::Accelerator control_space(ui::VKEY_SPACE, ui::EF_CONTROL_DOWN); |
| 670 const ui::Accelerator convert(ui::VKEY_CONVERT, ui::EF_NONE); | 682 const ui::Accelerator convert(ui::VKEY_CONVERT, ui::EF_NONE); |
| 671 const ui::Accelerator non_convert(ui::VKEY_NONCONVERT, ui::EF_NONE); | 683 const ui::Accelerator non_convert(ui::VKEY_NONCONVERT, ui::EF_NONE); |
| 672 const ui::Accelerator wide_half_1(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE); | 684 const ui::Accelerator wide_half_1(ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE); |
| 673 const ui::Accelerator wide_half_2(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE); | 685 const ui::Accelerator wide_half_2(ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 EXPECT_FALSE(GetController()->Process(shift_alt_press)); | 745 EXPECT_FALSE(GetController()->Process(shift_alt_press)); |
| 734 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); | 746 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); |
| 735 EXPECT_FALSE(GetController()->Process(shift_alt_x)); | 747 EXPECT_FALSE(GetController()->Process(shift_alt_x)); |
| 736 EXPECT_FALSE(GetController()->Process(shift_alt)); | 748 EXPECT_FALSE(GetController()->Process(shift_alt)); |
| 737 EXPECT_EQ(2, delegate->handle_next_ime_count()); | 749 EXPECT_EQ(2, delegate->handle_next_ime_count()); |
| 738 } | 750 } |
| 739 } | 751 } |
| 740 | 752 |
| 741 } // namespace test | 753 } // namespace test |
| 742 } // namespace ash | 754 } // namespace ash |
| OLD | NEW |