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

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

Issue 2170753005: Moves AcceleratorController from Shell to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 5 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 | « no previous file | ash/accelerators/accelerator_delegate.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/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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 void SetKeyboardBrightnessControlDelegate( 271 void SetKeyboardBrightnessControlDelegate(
272 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) { 272 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) {
273 WmShell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate); 273 WmShell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate);
274 } 274 }
275 275
276 private: 276 private:
277 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest); 277 DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest);
278 }; 278 };
279 279
280 AcceleratorController* AcceleratorControllerTest::GetController() { 280 AcceleratorController* AcceleratorControllerTest::GetController() {
281 return Shell::GetInstance()->accelerator_controller(); 281 return WmShell::Get()->accelerator_controller();
282 } 282 }
283 283
284 #if !defined(OS_WIN) 284 #if !defined(OS_WIN)
285 // Double press of exit shortcut => exiting 285 // Double press of exit shortcut => exiting
286 TEST_F(AcceleratorControllerTest, ExitWarningHandlerTestDoublePress) { 286 TEST_F(AcceleratorControllerTest, ExitWarningHandlerTestDoublePress) {
287 ui::Accelerator press(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); 287 ui::Accelerator press(ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
288 ui::Accelerator release(press); 288 ui::Accelerator release(press);
289 release.set_type(ui::ET_KEY_RELEASED); 289 release.set_type(ui::ET_KEY_RELEASED);
290 ExitWarningHandler* ewh = GetController()->GetExitWarningHandlerForTest(); 290 ExitWarningHandler* ewh = GetController()->GetExitWarningHandlerForTest();
291 ASSERT_TRUE(ewh); 291 ASSERT_TRUE(ewh);
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 EXPECT_TRUE(IsMessageCenterEmpty()); 1411 EXPECT_TRUE(IsMessageCenterEmpty());
1412 1412
1413 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1413 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1414 // screen before we proceed testing the rest of accelerators. 1414 // screen before we proceed testing the rest of accelerators.
1415 ResetStateIfNeeded(); 1415 ResetStateIfNeeded();
1416 } 1416 }
1417 } 1417 }
1418 #endif // defined(OS_CHROMEOS) 1418 #endif // defined(OS_CHROMEOS)
1419 1419
1420 } // namespace ash 1420 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698