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

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

Issue 10823402: Change the shortcut of toggling caps lock to Alt+Search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 delegate->ToggleSpokenFeedback(); 596 delegate->ToggleSpokenFeedback();
597 EXPECT_FALSE(GetController()->Process( 597 EXPECT_FALSE(GetController()->Process(
598 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 598 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
599 delegate->ToggleSpokenFeedback(); 599 delegate->ToggleSpokenFeedback();
600 EXPECT_TRUE(GetController()->Process( 600 EXPECT_TRUE(GetController()->Process(
601 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 601 ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
602 } 602 }
603 // ToggleCapsLock 603 // ToggleCapsLock
604 { 604 {
605 EXPECT_FALSE(GetController()->Process( 605 EXPECT_FALSE(GetController()->Process(
606 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); 606 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
607 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(false); 607 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(false);
608 GetController()->SetCapsLockDelegate( 608 GetController()->SetCapsLockDelegate(
609 scoped_ptr<CapsLockDelegate>(delegate).Pass()); 609 scoped_ptr<CapsLockDelegate>(delegate).Pass());
610 EXPECT_EQ(0, delegate->handle_caps_lock_count()); 610 EXPECT_EQ(0, delegate->handle_caps_lock_count());
611 EXPECT_FALSE(GetController()->Process( 611 EXPECT_FALSE(GetController()->Process(
612 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); 612 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
613 EXPECT_EQ(1, delegate->handle_caps_lock_count()); 613 EXPECT_EQ(1, delegate->handle_caps_lock_count());
614 } 614 }
615 { 615 {
616 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(true); 616 DummyCapsLockDelegate* delegate = new DummyCapsLockDelegate(true);
617 GetController()->SetCapsLockDelegate( 617 GetController()->SetCapsLockDelegate(
618 scoped_ptr<CapsLockDelegate>(delegate).Pass()); 618 scoped_ptr<CapsLockDelegate>(delegate).Pass());
619 EXPECT_EQ(0, delegate->handle_caps_lock_count()); 619 EXPECT_EQ(0, delegate->handle_caps_lock_count());
620 EXPECT_TRUE(GetController()->Process( 620 EXPECT_TRUE(GetController()->Process(
621 ui::Accelerator(ui::VKEY_LWIN, ui::EF_SHIFT_DOWN))); 621 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
622 EXPECT_EQ(1, delegate->handle_caps_lock_count()); 622 EXPECT_EQ(1, delegate->handle_caps_lock_count());
623 } 623 }
624 // Volume 624 // Volume
625 const ui::Accelerator f8(ui::VKEY_F8, ui::EF_NONE); 625 const ui::Accelerator f8(ui::VKEY_F8, ui::EF_NONE);
626 const ui::Accelerator f9(ui::VKEY_F9, ui::EF_NONE); 626 const ui::Accelerator f9(ui::VKEY_F9, ui::EF_NONE);
627 const ui::Accelerator f10(ui::VKEY_F10, ui::EF_NONE); 627 const ui::Accelerator f10(ui::VKEY_F10, ui::EF_NONE);
628 { 628 {
629 EXPECT_TRUE(GetController()->Process(f8)); 629 EXPECT_TRUE(GetController()->Process(f8));
630 EXPECT_TRUE(GetController()->Process(f9)); 630 EXPECT_TRUE(GetController()->Process(f9));
631 EXPECT_TRUE(GetController()->Process(f10)); 631 EXPECT_TRUE(GetController()->Process(f10));
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 EXPECT_FALSE(GetController()->IsReservedAccelerator( 989 EXPECT_FALSE(GetController()->IsReservedAccelerator(
990 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); 990 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE)));
991 EXPECT_FALSE(GetController()->IsReservedAccelerator( 991 EXPECT_FALSE(GetController()->IsReservedAccelerator(
992 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE))); 992 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE)));
993 EXPECT_FALSE(GetController()->IsReservedAccelerator( 993 EXPECT_FALSE(GetController()->IsReservedAccelerator(
994 ui::Accelerator(ui::VKEY_A, ui::EF_NONE))); 994 ui::Accelerator(ui::VKEY_A, ui::EF_NONE)));
995 } 995 }
996 996
997 } // namespace test 997 } // namespace test
998 } // namespace ash 998 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698