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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 const ui::Accelerator shift_alt_press(ui::VKEY_MENU, true, false, true); | 712 const ui::Accelerator shift_alt_press(ui::VKEY_MENU, true, false, true); |
713 const ReleaseAccelerator shift_alt(ui::VKEY_MENU, true, false, true); | 713 const ReleaseAccelerator shift_alt(ui::VKEY_MENU, true, false, true); |
714 const ui::Accelerator alt_shift_press(ui::VKEY_SHIFT, true, false, true); | 714 const ui::Accelerator alt_shift_press(ui::VKEY_SHIFT, true, false, true); |
715 const ReleaseAccelerator alt_shift(ui::VKEY_SHIFT, true, false, true); | 715 const ReleaseAccelerator alt_shift(ui::VKEY_SHIFT, true, false, true); |
716 | 716 |
717 DummyImeControlDelegate* delegate = new DummyImeControlDelegate(true); | 717 DummyImeControlDelegate* delegate = new DummyImeControlDelegate(true); |
718 GetController()->SetImeControlDelegate( | 718 GetController()->SetImeControlDelegate( |
719 scoped_ptr<ImeControlDelegate>(delegate).Pass()); | 719 scoped_ptr<ImeControlDelegate>(delegate).Pass()); |
720 EXPECT_EQ(0, delegate->handle_next_ime_count()); | 720 EXPECT_EQ(0, delegate->handle_next_ime_count()); |
721 EXPECT_FALSE(GetController()->Process(shift_alt_press)); | 721 EXPECT_FALSE(GetController()->Process(shift_alt_press)); |
722 EXPECT_FALSE(GetController()->Process(shift_alt)); // crbug.com/123720 | 722 EXPECT_TRUE(GetController()->Process(shift_alt)); |
723 EXPECT_EQ(1, delegate->handle_next_ime_count()); | 723 EXPECT_EQ(1, delegate->handle_next_ime_count()); |
724 EXPECT_FALSE(GetController()->Process(alt_shift_press)); | 724 EXPECT_FALSE(GetController()->Process(alt_shift_press)); |
725 EXPECT_FALSE(GetController()->Process(alt_shift)); // crbug.com/123720 | 725 EXPECT_TRUE(GetController()->Process(alt_shift)); |
726 EXPECT_EQ(2, delegate->handle_next_ime_count()); | 726 EXPECT_EQ(2, delegate->handle_next_ime_count()); |
727 | 727 |
728 // We should NOT switch IME when e.g. Shift+Alt+X is pressed and X is | 728 // We should NOT switch IME when e.g. Shift+Alt+X is pressed and X is |
729 // released. | 729 // released. |
730 const ui::Accelerator shift_alt_x_press(ui::VKEY_X, true, false, true); | 730 const ui::Accelerator shift_alt_x_press(ui::VKEY_X, true, false, true); |
731 const ReleaseAccelerator shift_alt_x(ui::VKEY_X, true, false, true); | 731 const ReleaseAccelerator shift_alt_x(ui::VKEY_X, true, false, true); |
732 | 732 |
733 EXPECT_FALSE(GetController()->Process(shift_alt_press)); | 733 EXPECT_FALSE(GetController()->Process(shift_alt_press)); |
734 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); | 734 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); |
735 EXPECT_FALSE(GetController()->Process(shift_alt_x)); | 735 EXPECT_FALSE(GetController()->Process(shift_alt_x)); |
736 EXPECT_FALSE(GetController()->Process(shift_alt)); | 736 EXPECT_FALSE(GetController()->Process(shift_alt)); |
737 EXPECT_EQ(2, delegate->handle_next_ime_count()); | 737 EXPECT_EQ(2, delegate->handle_next_ime_count()); |
738 } | 738 } |
739 } | 739 } |
740 | 740 |
741 } // namespace test | 741 } // namespace test |
742 } // namespace ash | 742 } // namespace ash |
OLD | NEW |