| 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/ime_control_delegate.h" | 8 #include "ash/ime_control_delegate.h" |
| 9 #include "ash/screenshot_delegate.h" | 9 #include "ash/screenshot_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/system/brightness/brightness_control_delegate.h" | 12 #include "ash/system/brightness/brightness_control_delegate.h" |
| 13 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 14 #include "ash/test/test_shell_delegate.h" |
| 14 #include "ash/volume_control_delegate.h" | 15 #include "ash/volume_control_delegate.h" |
| 15 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 16 #include "ui/aura/event.h" | 17 #include "ui/aura/event.h" |
| 17 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 18 #include "ui/aura/test/test_window_delegate.h" | 19 #include "ui/aura/test/test_window_delegate.h" |
| 19 #include "ui/aura/test/test_windows.h" | 20 #include "ui/aura/test/test_windows.h" |
| 20 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 21 | 22 |
| 22 #if defined(USE_X11) | 23 #if defined(USE_X11) |
| 23 #include <X11/Xlib.h> | 24 #include <X11/Xlib.h> |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 // ToggleAppList | 528 // ToggleAppList |
| 528 { | 529 { |
| 529 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); | 530 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); |
| 530 EXPECT_TRUE(GetController()->Process( | 531 EXPECT_TRUE(GetController()->Process( |
| 531 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); | 532 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); |
| 532 EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); | 533 EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); |
| 533 EXPECT_TRUE(GetController()->Process( | 534 EXPECT_TRUE(GetController()->Process( |
| 534 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); | 535 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); |
| 535 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); | 536 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); |
| 536 } | 537 } |
| 538 // ToggleAppList (with spoken feedback enabled) |
| 539 { |
| 540 ShellDelegate* delegate = ash::Shell::GetInstance()->delegate(); |
| 541 delegate->ToggleSpokenFeedback(); |
| 542 EXPECT_FALSE(GetController()->Process( |
| 543 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); |
| 544 delegate->ToggleSpokenFeedback(); |
| 545 EXPECT_TRUE(GetController()->Process( |
| 546 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); |
| 547 } |
| 537 // ToggleCapsLock | 548 // ToggleCapsLock |
| 538 { | 549 { |
| 539 EXPECT_FALSE(GetController()->Process( | 550 EXPECT_FALSE(GetController()->Process( |
| 540 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); | 551 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); |
| 541 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(false); | 552 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(false); |
| 542 GetController()->SetCapsLockDelegate( | 553 GetController()->SetCapsLockDelegate( |
| 543 scoped_ptr<CapsLockDelegate>(delegate).Pass()); | 554 scoped_ptr<CapsLockDelegate>(delegate).Pass()); |
| 544 EXPECT_EQ(0, delegate->handle_caps_lock_count()); | 555 EXPECT_EQ(0, delegate->handle_caps_lock_count()); |
| 545 EXPECT_FALSE(GetController()->Process( | 556 EXPECT_FALSE(GetController()->Process( |
| 546 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); | 557 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 EXPECT_FALSE(GetController()->Process(shift_alt_press)); | 834 EXPECT_FALSE(GetController()->Process(shift_alt_press)); |
| 824 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); | 835 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); |
| 825 EXPECT_FALSE(GetController()->Process(shift_alt_x)); | 836 EXPECT_FALSE(GetController()->Process(shift_alt_x)); |
| 826 EXPECT_FALSE(GetController()->Process(shift_alt)); | 837 EXPECT_FALSE(GetController()->Process(shift_alt)); |
| 827 EXPECT_EQ(2, delegate->handle_next_ime_count()); | 838 EXPECT_EQ(2, delegate->handle_next_ime_count()); |
| 828 } | 839 } |
| 829 } | 840 } |
| 830 | 841 |
| 831 } // namespace test | 842 } // namespace test |
| 832 } // namespace ash | 843 } // namespace ash |
| OLD | NEW |