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

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

Issue 11580005: Don't fire Alt-Search binding when Alt-Search is being used for accessing a modifer key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | 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/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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 EXPECT_FALSE(ProcessWithContext( 703 EXPECT_FALSE(ProcessWithContext(
704 ui::Accelerator(ui::VKEY_SHIFT, ui::EF_NONE))); 704 ui::Accelerator(ui::VKEY_SHIFT, ui::EF_NONE)));
705 EXPECT_FALSE(ProcessWithContext( 705 EXPECT_FALSE(ProcessWithContext(
706 ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE))); 706 ReleaseAccelerator(ui::VKEY_SHIFT, ui::EF_NONE)));
707 } 707 }
708 // ToggleCapsLock 708 // ToggleCapsLock
709 { 709 {
710 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate(); 710 CapsLockDelegate* delegate = Shell::GetInstance()->caps_lock_delegate();
711 delegate->SetCapsLockEnabled(true); 711 delegate->SetCapsLockEnabled(true);
712 EXPECT_TRUE(delegate->IsCapsLockEnabled()); 712 EXPECT_TRUE(delegate->IsCapsLockEnabled());
713 EXPECT_FALSE(ProcessWithContext(
714 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
713 EXPECT_TRUE(ProcessWithContext( 715 EXPECT_TRUE(ProcessWithContext(
716 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
717 EXPECT_FALSE(delegate->IsCapsLockEnabled());
718 EXPECT_FALSE(ProcessWithContext(
714 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); 719 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
715 EXPECT_FALSE(delegate->IsCapsLockEnabled());
716 EXPECT_TRUE(ProcessWithContext( 720 EXPECT_TRUE(ProcessWithContext(
717 ui::Accelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN))); 721 ReleaseAccelerator(ui::VKEY_LWIN, ui::EF_ALT_DOWN)));
718 EXPECT_TRUE(delegate->IsCapsLockEnabled()); 722 EXPECT_TRUE(delegate->IsCapsLockEnabled());
719 } 723 }
720 const ui::Accelerator volume_mute(ui::VKEY_VOLUME_MUTE, ui::EF_NONE); 724 const ui::Accelerator volume_mute(ui::VKEY_VOLUME_MUTE, ui::EF_NONE);
721 const ui::Accelerator volume_down(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); 725 const ui::Accelerator volume_down(ui::VKEY_VOLUME_DOWN, ui::EF_NONE);
722 const ui::Accelerator volume_up(ui::VKEY_VOLUME_UP, ui::EF_NONE); 726 const ui::Accelerator volume_up(ui::VKEY_VOLUME_UP, ui::EF_NONE);
723 { 727 {
724 DummyVolumeControlDelegate* delegate = 728 DummyVolumeControlDelegate* delegate =
725 new DummyVolumeControlDelegate(false); 729 new DummyVolumeControlDelegate(false);
726 ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate( 730 ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate(
727 scoped_ptr<VolumeControlDelegate>(delegate).Pass()); 731 scoped_ptr<VolumeControlDelegate>(delegate).Pass());
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 EXPECT_EQ(volume_down, delegate->last_accelerator()); 1280 EXPECT_EQ(volume_down, delegate->last_accelerator());
1277 EXPECT_EQ(0, delegate->handle_volume_up_count()); 1281 EXPECT_EQ(0, delegate->handle_volume_up_count());
1278 EXPECT_TRUE(ProcessWithContext(volume_up)); 1282 EXPECT_TRUE(ProcessWithContext(volume_up));
1279 EXPECT_EQ(1, delegate->handle_volume_up_count()); 1283 EXPECT_EQ(1, delegate->handle_volume_up_count());
1280 EXPECT_EQ(volume_up, delegate->last_accelerator()); 1284 EXPECT_EQ(volume_up, delegate->last_accelerator());
1281 } 1285 }
1282 } 1286 }
1283 #endif 1287 #endif
1284 1288
1285 } // namespace ash 1289 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698