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

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

Issue 10383108: Adding four bezel gestures (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 8 years, 7 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
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/test/test_launcher_delegate.h » ('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/caps_lock_delegate.h" 6 #include "ash/caps_lock_delegate.h"
7 #include "ash/ime_control_delegate.h" 7 #include "ash/ime_control_delegate.h"
8 #include "ash/screenshot_delegate.h" 8 #include "ash/screenshot_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 DISALLOW_COPY_AND_ASSIGN(DummyCapsLockDelegate); 120 DISALLOW_COPY_AND_ASSIGN(DummyCapsLockDelegate);
121 }; 121 };
122 122
123 class DummyVolumeControlDelegate : public VolumeControlDelegate { 123 class DummyVolumeControlDelegate : public VolumeControlDelegate {
124 public: 124 public:
125 explicit DummyVolumeControlDelegate(bool consume) 125 explicit DummyVolumeControlDelegate(bool consume)
126 : consume_(consume), 126 : consume_(consume),
127 handle_volume_mute_count_(0), 127 handle_volume_mute_count_(0),
128 handle_volume_down_count_(0), 128 handle_volume_down_count_(0),
129 handle_volume_up_count_(0) { 129 handle_volume_up_count_(0){
sky 2012/05/18 19:49:31 nit: leave the space here.
Mr4D (OOO till 08-26) 2012/05/18 20:30:04 Done.
130 } 130 }
131 virtual ~DummyVolumeControlDelegate() {} 131 virtual ~DummyVolumeControlDelegate() {}
132 132
133 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE { 133 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE {
134 ++handle_volume_mute_count_; 134 ++handle_volume_mute_count_;
135 last_accelerator_ = accelerator; 135 last_accelerator_ = accelerator;
136 return consume_; 136 return consume_;
137 } 137 }
138 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE { 138 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE {
139 ++handle_volume_down_count_; 139 ++handle_volume_down_count_;
140 last_accelerator_ = accelerator; 140 last_accelerator_ = accelerator;
141 return consume_; 141 return consume_;
142 } 142 }
143 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE { 143 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE {
144 ++handle_volume_up_count_; 144 ++handle_volume_up_count_;
145 last_accelerator_ = accelerator; 145 last_accelerator_ = accelerator;
146 return consume_; 146 return consume_;
147 } 147 }
148 virtual void SetVolumePercent(double percent) OVERRIDE {
149 }
148 150
149 int handle_volume_mute_count() const { 151 int handle_volume_mute_count() const {
150 return handle_volume_mute_count_; 152 return handle_volume_mute_count_;
151 } 153 }
152 int handle_volume_down_count() const { 154 int handle_volume_down_count() const {
153 return handle_volume_down_count_; 155 return handle_volume_down_count_;
154 } 156 }
155 int handle_volume_up_count() const { 157 int handle_volume_up_count() const {
156 return handle_volume_up_count_; 158 return handle_volume_up_count_;
157 } 159 }
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 EXPECT_FALSE(GetController()->Process(shift_alt_press)); 736 EXPECT_FALSE(GetController()->Process(shift_alt_press));
735 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); 737 EXPECT_FALSE(GetController()->Process(shift_alt_x_press));
736 EXPECT_FALSE(GetController()->Process(shift_alt_x)); 738 EXPECT_FALSE(GetController()->Process(shift_alt_x));
737 EXPECT_FALSE(GetController()->Process(shift_alt)); 739 EXPECT_FALSE(GetController()->Process(shift_alt));
738 EXPECT_EQ(2, delegate->handle_next_ime_count()); 740 EXPECT_EQ(2, delegate->handle_next_ime_count());
739 } 741 }
740 } 742 }
741 743
742 } // namespace test 744 } // namespace test
743 } // namespace ash 745 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/test/test_launcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698