| Index: ash/accelerators/accelerator_controller_unittest.cc
|
| diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
|
| index 7012f4f33aa2bcffbfd6ba162e1444b2e2ffa1cb..b6f925427237e4f1aaadff15e24931454721fa6f 100644
|
| --- a/ash/accelerators/accelerator_controller_unittest.cc
|
| +++ b/ash/accelerators/accelerator_controller_unittest.cc
|
| @@ -628,26 +628,6 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
|
| EXPECT_EQ(2, delegate->handle_take_screenshot_count());
|
| }
|
| #endif
|
| - // ToggleAppList
|
| - {
|
| - EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| - EXPECT_TRUE(ProcessWithContext(
|
| - ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| - EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| - EXPECT_TRUE(ProcessWithContext(
|
| - ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| - EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| - }
|
| - // ToggleAppList (with spoken feedback enabled)
|
| - {
|
| - ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
|
| - delegate->ToggleSpokenFeedback();
|
| - EXPECT_FALSE(ProcessWithContext(
|
| - ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| - delegate->ToggleSpokenFeedback();
|
| - EXPECT_TRUE(ProcessWithContext(
|
| - ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| - }
|
| // DisableCapsLock
|
| {
|
| CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate();
|
| @@ -962,6 +942,88 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
|
| #endif
|
| }
|
|
|
| +TEST_F(AcceleratorControllerTest,
|
| + GlobalAcceleratorsToggleAppListWithoutSearchAsModifier) {
|
| + ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
|
| +
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When Search is not acting as a modifier, pressing Search should toggle
|
| + // the AppList
|
| + EXPECT_TRUE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When spoken feedback is on, the AppList should not toggle.
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + EXPECT_TRUE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When spoken feedback is on, the AppList should not toggle.
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +}
|
| +
|
| +TEST_F(AcceleratorControllerTest,
|
| + GlobalAcceleratorsToggleAppListWithSearchAsModifier) {
|
| + test::TestShellDelegate* delegate =
|
| + reinterpret_cast<test::TestShellDelegate*>(
|
| + ash::Shell::GetInstance()->delegate());
|
| + delegate->set_is_search_key_acting_as_function_key(true);
|
| +
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When Search is acting as a modifier for accessing extended keyboard
|
| + // shortcuts, then the press event should not open the AppList, and the
|
| + // release should instead.
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_TRUE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When spoken feedback is on, the AppList should not toggle.
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_TRUE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +
|
| + // When spoken feedback is on, the AppList should not toggle.
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + EXPECT_FALSE(ProcessWithContext(
|
| + ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
|
| + delegate->ToggleSpokenFeedback();
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
|
| +}
|
| +
|
| TEST_F(AcceleratorControllerTest, ImeGlobalAccelerators) {
|
| // Test IME shortcuts.
|
| {
|
|
|