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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
8 #include "ash/common/accelerators/accelerator_table.h" | 8 #include "ash/common/accelerators/accelerator_table.h" |
9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 } // namespace | 200 } // namespace |
201 | 201 |
202 class AcceleratorControllerTest : public test::AshTestBase { | 202 class AcceleratorControllerTest : public test::AshTestBase { |
203 public: | 203 public: |
204 AcceleratorControllerTest() {} | 204 AcceleratorControllerTest() {} |
205 ~AcceleratorControllerTest() override {} | 205 ~AcceleratorControllerTest() override {} |
206 | 206 |
207 protected: | 207 protected: |
208 void EnableInternalDisplay() { | |
209 test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); | |
210 } | |
211 | |
212 static AcceleratorController* GetController(); | 208 static AcceleratorController* GetController(); |
213 | 209 |
214 static bool ProcessInController(const ui::Accelerator& accelerator) { | 210 static bool ProcessInController(const ui::Accelerator& accelerator) { |
215 if (accelerator.type() == ui::ET_KEY_RELEASED) { | 211 if (accelerator.type() == ui::ET_KEY_RELEASED) { |
216 // If the |accelerator| should trigger on release, then we store the | 212 // If the |accelerator| should trigger on release, then we store the |
217 // pressed version of it first in history then the released one to | 213 // pressed version of it first in history then the released one to |
218 // simulate what happens in reality. | 214 // simulate what happens in reality. |
219 ui::Accelerator pressed_accelerator = accelerator; | 215 ui::Accelerator pressed_accelerator = accelerator; |
220 pressed_accelerator.set_type(ui::ET_KEY_PRESSED); | 216 pressed_accelerator.set_type(ui::ET_KEY_PRESSED); |
221 GetController()->accelerator_history()->StoreCurrentAccelerator( | 217 GetController()->accelerator_history()->StoreCurrentAccelerator( |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 EXPECT_TRUE(IsMessageCenterEmpty()); | 1407 EXPECT_TRUE(IsMessageCenterEmpty()); |
1412 | 1408 |
1413 // If the action is LOCK_SCREEN, we must reset the state by unlocking the | 1409 // If the action is LOCK_SCREEN, we must reset the state by unlocking the |
1414 // screen before we proceed testing the rest of accelerators. | 1410 // screen before we proceed testing the rest of accelerators. |
1415 ResetStateIfNeeded(); | 1411 ResetStateIfNeeded(); |
1416 } | 1412 } |
1417 } | 1413 } |
1418 #endif // defined(OS_CHROMEOS) | 1414 #endif // defined(OS_CHROMEOS) |
1419 | 1415 |
1420 } // namespace ash | 1416 } // namespace ash |
OLD | NEW |