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

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

Issue 2825533003: mash: Prerequisites for removing ShelfDelegate. (Closed)
Patch Set: Expand CheckWindowAndItemPlacement comment. Created 3 years, 8 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/metrics/user_metrics_recorder_unittest.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 6
7 #include "ash/accelerators/accelerator_table.h" 7 #include "ash/accelerators/accelerator_table.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
11 #include "ash/ime_control_delegate.h" 11 #include "ash/ime_control_delegate.h"
12 #include "ash/public/cpp/config.h" 12 #include "ash/public/cpp/config.h"
13 #include "ash/public/cpp/shell_window_ids.h" 13 #include "ash/public/cpp/shell_window_ids.h"
14 #include "ash/session/session_controller.h" 14 #include "ash/session/session_controller.h"
15 #include "ash/shell.h" 15 #include "ash/shell.h"
16 #include "ash/shell_port.h" 16 #include "ash/shell_port.h"
17 #include "ash/system/brightness_control_delegate.h" 17 #include "ash/system/brightness_control_delegate.h"
18 #include "ash/system/keyboard_brightness_control_delegate.h" 18 #include "ash/system/keyboard_brightness_control_delegate.h"
19 #include "ash/system/tray/system_tray_delegate.h" 19 #include "ash/system/tray/system_tray_delegate.h"
20 #include "ash/test/ash_test_base.h" 20 #include "ash/test/ash_test_base.h"
21 #include "ash/test/lock_state_controller_test_api.h" 21 #include "ash/test/lock_state_controller_test_api.h"
22 #include "ash/test/test_screenshot_delegate.h" 22 #include "ash/test/test_screenshot_delegate.h"
23 #include "ash/test/test_session_state_animator.h" 23 #include "ash/test/test_session_state_animator.h"
24 #include "ash/test/test_shelf_delegate.h"
25 #include "ash/wm/lock_state_controller.h" 24 #include "ash/wm/lock_state_controller.h"
26 #include "ash/wm/panels/panel_layout_manager.h" 25 #include "ash/wm/panels/panel_layout_manager.h"
27 #include "ash/wm/window_positioning_utils.h" 26 #include "ash/wm/window_positioning_utils.h"
28 #include "ash/wm/window_state.h" 27 #include "ash/wm/window_state.h"
29 #include "ash/wm/window_state_aura.h" 28 #include "ash/wm/window_state_aura.h"
30 #include "ash/wm/window_util.h" 29 #include "ash/wm/window_util.h"
31 #include "ash/wm/wm_event.h" 30 #include "ash/wm/wm_event.h"
32 #include "ash/wm_window.h" 31 #include "ash/wm_window.h"
33 #include "base/command_line.h" 32 #include "base/command_line.h"
34 #include "base/test/user_action_tester.cc" 33 #include "base/test/user_action_tester.cc"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 static void SimulateTimerExpired(ExitWarningHandler* ewh) { 247 static void SimulateTimerExpired(ExitWarningHandler* ewh) {
249 ewh->TimerAction(); 248 ewh->TimerAction();
250 } 249 }
251 static bool is_ui_shown(ExitWarningHandler* ewh) { return !!ewh->widget_; } 250 static bool is_ui_shown(ExitWarningHandler* ewh) { return !!ewh->widget_; }
252 static bool is_idle(ExitWarningHandler* ewh) { 251 static bool is_idle(ExitWarningHandler* ewh) {
253 return ewh->state_ == ExitWarningHandler::IDLE; 252 return ewh->state_ == ExitWarningHandler::IDLE;
254 } 253 }
255 static bool is_exiting(ExitWarningHandler* ewh) { 254 static bool is_exiting(ExitWarningHandler* ewh) {
256 return ewh->state_ == ExitWarningHandler::EXITING; 255 return ewh->state_ == ExitWarningHandler::EXITING;
257 } 256 }
258 aura::Window* CreatePanel() {
259 aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
260 NULL, ui::wm::WINDOW_TYPE_PANEL, 0, gfx::Rect(5, 5, 20, 20));
261 WmWindow* wm_window = WmWindow::Get(window);
262 test::TestShelfDelegate::instance()->AddShelfItem(wm_window);
263 PanelLayoutManager::Get(wm_window)->Relayout();
264 return window;
265 }
266 257
267 void SetBrightnessControlDelegate( 258 void SetBrightnessControlDelegate(
268 std::unique_ptr<BrightnessControlDelegate> delegate) { 259 std::unique_ptr<BrightnessControlDelegate> delegate) {
269 Shell::Get()->brightness_control_delegate_ = std::move(delegate); 260 Shell::Get()->brightness_control_delegate_ = std::move(delegate);
270 } 261 }
271 262
272 void SetKeyboardBrightnessControlDelegate( 263 void SetKeyboardBrightnessControlDelegate(
273 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) { 264 std::unique_ptr<KeyboardBrightnessControlDelegate> delegate) {
274 Shell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate); 265 Shell::Get()->keyboard_brightness_control_delegate_ = std::move(delegate);
275 } 266 }
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 // Expect no notifications from the new accelerators. 1362 // Expect no notifications from the new accelerators.
1372 EXPECT_TRUE(IsMessageCenterEmpty()); 1363 EXPECT_TRUE(IsMessageCenterEmpty());
1373 1364
1374 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1365 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1375 // screen before we proceed testing the rest of accelerators. 1366 // screen before we proceed testing the rest of accelerators.
1376 ResetStateIfNeeded(); 1367 ResetStateIfNeeded();
1377 } 1368 }
1378 } 1369 }
1379 1370
1380 } // namespace ash 1371 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/metrics/user_metrics_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698