Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 11421055: Add power-user keyboard mode for ChromeOS with Search key acting as a typical Fn key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove DropSearchKey function Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); 624 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE)));
625 EXPECT_EQ(2, delegate->handle_take_screenshot_count()); 625 EXPECT_EQ(2, delegate->handle_take_screenshot_count());
626 EXPECT_TRUE(ProcessWithContext( 626 EXPECT_TRUE(ProcessWithContext(
627 ui::Accelerator(ui::VKEY_F5, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN))); 627 ui::Accelerator(ui::VKEY_F5, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN)));
628 EXPECT_EQ(2, delegate->handle_take_screenshot_count()); 628 EXPECT_EQ(2, delegate->handle_take_screenshot_count());
629 } 629 }
630 #endif 630 #endif
631 // ToggleAppList 631 // ToggleAppList
632 { 632 {
633 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); 633 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
634 // Pressing the search key should do nothing, since the Search key can be
635 // used as a modifier for accessing extended keyboard shortcuts.
636 EXPECT_FALSE(ProcessWithContext(
637 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
634 EXPECT_TRUE(ProcessWithContext( 638 EXPECT_TRUE(ProcessWithContext(
639 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
640 EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
641 EXPECT_FALSE(ProcessWithContext(
635 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 642 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
636 EXPECT_TRUE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
637 EXPECT_TRUE(ProcessWithContext( 643 EXPECT_TRUE(ProcessWithContext(
638 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 644 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
639 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility()); 645 EXPECT_FALSE(ash::Shell::GetInstance()->GetAppListTargetVisibility());
640 } 646 }
641 // ToggleAppList (with spoken feedback enabled) 647 // ToggleAppList (with spoken feedback enabled)
642 { 648 {
643 ShellDelegate* delegate = ash::Shell::GetInstance()->delegate(); 649 ShellDelegate* delegate = ash::Shell::GetInstance()->delegate();
644 delegate->ToggleSpokenFeedback(); 650 delegate->ToggleSpokenFeedback();
645 EXPECT_FALSE(ProcessWithContext( 651 EXPECT_FALSE(ProcessWithContext(
646 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 652 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
653 EXPECT_FALSE(ProcessWithContext(
654 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
647 delegate->ToggleSpokenFeedback(); 655 delegate->ToggleSpokenFeedback();
656 EXPECT_FALSE(ProcessWithContext(
657 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
648 EXPECT_TRUE(ProcessWithContext( 658 EXPECT_TRUE(ProcessWithContext(
649 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 659 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_NONE)));
650 } 660 }
651 // DisableCapsLock 661 // DisableCapsLock
652 { 662 {
653 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate(); 663 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate();
654 delegate->SetCapsLockEnabled(true); 664 delegate->SetCapsLockEnabled(true);
655 EXPECT_TRUE(delegate->IsCapsLockEnabled()); 665 EXPECT_TRUE(delegate->IsCapsLockEnabled());
656 // Handled only on key release. 666 // Handled only on key release.
657 EXPECT_FALSE(ProcessWithContext( 667 EXPECT_FALSE(ProcessWithContext(
658 ui::Accelerator(ui::VKEY_LSHIFT, ui::EF_NONE))); 668 ui::Accelerator(ui::VKEY_LSHIFT, ui::EF_NONE)));
659 EXPECT_TRUE(delegate->IsCapsLockEnabled()); 669 EXPECT_TRUE(delegate->IsCapsLockEnabled());
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 EXPECT_EQ(f9, delegate->last_accelerator()); 1274 EXPECT_EQ(f9, delegate->last_accelerator());
1265 EXPECT_EQ(0, delegate->handle_volume_up_count()); 1275 EXPECT_EQ(0, delegate->handle_volume_up_count());
1266 EXPECT_TRUE(ProcessWithContext(f10)); 1276 EXPECT_TRUE(ProcessWithContext(f10));
1267 EXPECT_EQ(1, delegate->handle_volume_up_count()); 1277 EXPECT_EQ(1, delegate->handle_volume_up_count());
1268 EXPECT_EQ(f10, delegate->last_accelerator()); 1278 EXPECT_EQ(f10, delegate->last_accelerator());
1269 } 1279 }
1270 } 1280 }
1271 #endif 1281 #endif
1272 1282
1273 } // namespace ash 1283 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698