[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 5 | #include "ash/public/cpp/test/shell_test_api.h" |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 6 | |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 7 | #include <memory> |
xiyuan | 317fdbe | 2017-05-31 15:02:02 | [diff] [blame] | 8 | #include <utility> |
| 9 | |
Evan Stade | 7768d47 | 2018-10-25 22:40:17 | [diff] [blame] | 10 | #include "ash/accelerators/accelerator_commands.h" |
Alexander Alekseev | 2b4c959 | 2021-05-04 22:26:44 | [diff] [blame] | 11 | #include "ash/accelerators/accelerator_controller_impl.h" |
Mitsuru Oshima | 8abd8b1d0 | 2019-05-09 17:55:23 | [diff] [blame] | 12 | #include "ash/accelerometer/accelerometer_reader.h" |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 13 | #include "ash/app_list/app_list_controller_impl.h" |
James Cook | 4f4c361 | 2021-05-27 21:45:22 | [diff] [blame] | 14 | #include "ash/app_list/app_list_presenter_impl.h" |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 15 | #include "ash/app_list/views/app_list_view.h" |
Alexander Alekseev | 2b4c959 | 2021-05-04 22:26:44 | [diff] [blame] | 16 | #include "ash/hud_display/hud_display.h" |
Darren Shen | 7daf3e1 | 2019-07-02 07:25:49 | [diff] [blame] | 17 | #include "ash/keyboard/keyboard_controller_impl.h" |
Mitsuru Oshima | 9a6378d9 | 2019-11-01 00:48:15 | [diff] [blame] | 18 | #include "ash/public/cpp/autotest_private_api_utils.h" |
Mitsuru Oshima | a6adca4f | 2019-07-10 23:30:46 | [diff] [blame] | 19 | #include "ash/public/cpp/tablet_mode_observer.h" |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 20 | #include "ash/root_window_controller.h" |
| 21 | #include "ash/shell.h" |
Ahmed Mehfooz | 812c542 | 2021-03-29 22:42:16 | [diff] [blame] | 22 | #include "ash/system/message_center/session_state_notification_blocker.h" |
Toni Barzic | 9d0c82f4 | 2017-12-06 00:53:52 | [diff] [blame] | 23 | #include "ash/system/power/backlights_forced_off_setter.h" |
Qiang Xu | 0a86020f | 2017-10-12 08:34:54 | [diff] [blame] | 24 | #include "ash/system/power/power_button_controller.h" |
Jun Mukai | 2b91e70 | 2019-09-05 18:24:38 | [diff] [blame] | 25 | #include "ash/wm/overview/overview_animation_state_waiter.h" |
Sammie Quon | 80e82a1 | 2019-01-23 19:55:22 | [diff] [blame] | 26 | #include "ash/wm/overview/overview_controller.h" |
Evan Stade | 426a298 | 2018-10-19 22:42:07 | [diff] [blame] | 27 | #include "ash/wm/splitview/split_view_controller.h" |
Evan Stade | d689b33 | 2018-08-02 01:17:22 | [diff] [blame] | 28 | #include "ash/wm/tablet_mode/tablet_mode_controller.h" |
Ahmed Fakhry | fee7a0a | 2019-04-05 22:49:48 | [diff] [blame] | 29 | #include "ash/wm/workspace_controller.h" |
Peter Boström | bceb9af | 2021-05-27 18:18:58 | [diff] [blame] | 30 | #include "base/bind.h" |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 31 | #include "base/run_loop.h" |
James Cook | bbe5cb1 | 2017-08-08 18:32:21 | [diff] [blame] | 32 | #include "components/prefs/testing_pref_service.h" |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 33 | #include "ui/aura/window_tree_host.h" |
| 34 | #include "ui/compositor/compositor.h" |
| 35 | #include "ui/compositor/compositor_observer.h" |
Lei Zhang | 0c04332 | 2021-04-27 16:43:05 | [diff] [blame] | 36 | #include "ui/compositor/layer.h" |
Sammie Quon | 358e957 | 2019-11-21 04:38:02 | [diff] [blame] | 37 | #include "ui/compositor/layer_animation_observer.h" |
Sammie Quon | 4986fdf | 2020-05-15 19:33:58 | [diff] [blame] | 38 | #include "ui/display/manager/display_manager.h" |
Ahmed Fakhry | 607ade0 | 2019-10-31 15:59:39 | [diff] [blame] | 39 | #include "ui/events/devices/device_data_manager_test_api.h" |
Jun Mukai | 2af6db5 | 2019-01-09 00:22:42 | [diff] [blame] | 40 | #include "ui/events/gesture_detection/gesture_configuration.h" |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 41 | |
| 42 | namespace ash { |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 43 | namespace { |
| 44 | |
| 45 | // Wait for a WindowTreeHost to no longer be holding pointer events. |
| 46 | class PointerMoveLoopWaiter : public ui::CompositorObserver { |
| 47 | public: |
| 48 | explicit PointerMoveLoopWaiter(aura::WindowTreeHost* window_tree_host) |
| 49 | : window_tree_host_(window_tree_host) { |
| 50 | window_tree_host_->compositor()->AddObserver(this); |
| 51 | } |
| 52 | |
| 53 | ~PointerMoveLoopWaiter() override { |
| 54 | window_tree_host_->compositor()->RemoveObserver(this); |
| 55 | } |
| 56 | |
| 57 | void Wait() { |
| 58 | // Use a while loop as it's possible for releasing the lock to trigger |
| 59 | // processing events, which again grabs the lock. |
| 60 | while (window_tree_host_->holding_pointer_moves()) { |
| 61 | run_loop_ = std::make_unique<base::RunLoop>( |
| 62 | base::RunLoop::Type::kNestableTasksAllowed); |
| 63 | run_loop_->Run(); |
| 64 | run_loop_.reset(); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | // ui::CompositorObserver: |
| 69 | void OnCompositingEnded(ui::Compositor* compositor) override { |
| 70 | if (run_loop_) |
| 71 | run_loop_->Quit(); |
| 72 | } |
| 73 | |
| 74 | private: |
| 75 | aura::WindowTreeHost* window_tree_host_; |
| 76 | std::unique_ptr<base::RunLoop> run_loop_; |
| 77 | |
| 78 | DISALLOW_COPY_AND_ASSIGN(PointerMoveLoopWaiter); |
| 79 | }; |
| 80 | |
Sammie Quon | 358e957 | 2019-11-21 04:38:02 | [diff] [blame] | 81 | class WindowAnimationWaiter : public ui::LayerAnimationObserver { |
| 82 | public: |
| 83 | explicit WindowAnimationWaiter(aura::Window* window) |
| 84 | : animator_(window->layer()->GetAnimator()) { |
| 85 | animator_->AddObserver(this); |
| 86 | } |
| 87 | ~WindowAnimationWaiter() override = default; |
| 88 | |
| 89 | WindowAnimationWaiter(const WindowAnimationWaiter& other) = delete; |
| 90 | WindowAnimationWaiter& operator=(const WindowAnimationWaiter& rhs) = delete; |
| 91 | |
| 92 | // ui::LayerAnimationObserver: |
| 93 | void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override { |
| 94 | if (!animator_->is_animating()) { |
| 95 | animator_->RemoveObserver(this); |
| 96 | run_loop_.Quit(); |
| 97 | } |
| 98 | } |
| 99 | void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override {} |
| 100 | void OnLayerAnimationScheduled( |
| 101 | ui::LayerAnimationSequence* sequence) override {} |
| 102 | |
| 103 | void Wait() { |
Sammie Quon | 358e957 | 2019-11-21 04:38:02 | [diff] [blame] | 104 | run_loop_.Run(); |
| 105 | } |
| 106 | |
| 107 | private: |
| 108 | ui::LayerAnimator* animator_; |
| 109 | base::RunLoop run_loop_; |
| 110 | }; |
| 111 | |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 112 | } // namespace |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 113 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 114 | ShellTestApi::ShellTestApi() : shell_(Shell::Get()) {} |
| 115 | ShellTestApi::~ShellTestApi() = default; |
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 116 | |
Sammie Quon | 408e9da | 2019-06-20 19:36:21 | [diff] [blame] | 117 | // static |
| 118 | void ShellTestApi::SetTabletControllerUseScreenshotForTest( |
| 119 | bool use_screenshot) { |
| 120 | TabletModeController::SetUseScreenshotForTest(use_screenshot); |
| 121 | } |
| 122 | |
Ahmed Mehfooz | 812c542 | 2021-03-29 22:42:16 | [diff] [blame] | 123 | // static |
| 124 | void ShellTestApi::SetUseLoginNotificationDelayForTest(bool use_delay) { |
| 125 | SessionStateNotificationBlocker::SetUseLoginNotificationDelayForTest( |
| 126 | use_delay); |
| 127 | } |
| 128 | |
Zentaro Kavanagh | 1f43649 | 2021-05-20 23:29:36 | [diff] [blame] | 129 | // static |
| 130 | void ShellTestApi::SetShouldShowShortcutNotificationForTest( |
| 131 | bool show_notification) { |
| 132 | AcceleratorControllerImpl::SetShouldShowShortcutNotificationForTest( |
| 133 | show_notification); |
| 134 | } |
| 135 | |
James Cook | 459354b3 | 2017-09-27 23:18:01 | [diff] [blame] | 136 | MessageCenterController* ShellTestApi::message_center_controller() { |
| 137 | return shell_->message_center_controller_.get(); |
| 138 | } |
| 139 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 140 | WorkspaceController* ShellTestApi::workspace_controller() { |
Ahmed Fakhry | fee7a0a | 2019-04-05 22:49:48 | [diff] [blame] | 141 | // TODO(afakhry): Split this into two, one for root, and one for context. |
| 142 | return GetActiveWorkspaceController(shell_->GetPrimaryRootWindow()); |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 143 | } |
| 144 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 145 | ScreenPositionController* ShellTestApi::screen_position_controller() { |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 146 | return shell_->screen_position_controller_.get(); |
| 147 | } |
| 148 | |
erg | 36cfb95 | 2017-06-21 19:41:45 | [diff] [blame] | 149 | NativeCursorManagerAsh* ShellTestApi::native_cursor_manager_ash() { |
[email protected] | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 150 | return shell_->native_cursor_manager_; |
| 151 | } |
| 152 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 153 | DragDropController* ShellTestApi::drag_drop_controller() { |
[email protected] | c086bab | 2013-06-06 21:46:44 | [diff] [blame] | 154 | return shell_->drag_drop_controller_.get(); |
| 155 | } |
| 156 | |
Qiang Xu | 36234e53 | 2018-04-11 04:54:02 | [diff] [blame] | 157 | PowerPrefs* ShellTestApi::power_prefs() { |
| 158 | return shell_->power_prefs_.get(); |
| 159 | } |
| 160 | |
Sammie Quon | 4986fdf | 2020-05-15 19:33:58 | [diff] [blame] | 161 | display::DisplayManager* ShellTestApi::display_manager() { |
| 162 | return shell_->display_manager(); |
| 163 | } |
| 164 | |
Qiang Xu | 50c6f8c | 2017-08-31 20:55:24 | [diff] [blame] | 165 | void ShellTestApi::ResetPowerButtonControllerForTest() { |
Toni Barzic | 9d0c82f4 | 2017-12-06 00:53:52 | [diff] [blame] | 166 | shell_->backlights_forced_off_setter_->ResetForTest(); |
| 167 | shell_->power_button_controller_ = std::make_unique<PowerButtonController>( |
| 168 | shell_->backlights_forced_off_setter_.get()); |
Qiang Xu | 50c6f8c | 2017-08-31 20:55:24 | [diff] [blame] | 169 | } |
| 170 | |
James Cook | 7b7c6a5 | 2018-01-04 23:40:03 | [diff] [blame] | 171 | void ShellTestApi::SimulateModalWindowOpenForTest(bool modal_window_open) { |
| 172 | shell_->simulate_modal_window_open_for_test_ = modal_window_open; |
| 173 | } |
| 174 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 175 | bool ShellTestApi::IsSystemModalWindowOpen() { |
| 176 | return Shell::IsSystemModalWindowOpen(); |
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 177 | } |
| 178 | |
James Cook | bbca645 | 2021-01-13 17:26:03 | [diff] [blame] | 179 | void ShellTestApi::SetTabletModeEnabledForTest(bool enable) { |
Ahmed Fakhry | 607ade0 | 2019-10-31 15:59:39 | [diff] [blame] | 180 | // Detach mouse devices, so we can enter tablet mode. |
| 181 | // Calling RunUntilIdle() here is necessary before setting the mouse devices |
| 182 | // to prevent the callback from evdev thread from overwriting whatever we set |
| 183 | // here below. See `InputDeviceFactoryEvdevProxy::OnStartupScanComplete()`. |
| 184 | base::RunLoop().RunUntilIdle(); |
Xiaoqian Dai | 7e18245 | 2020-05-05 23:29:19 | [diff] [blame] | 185 | ui::DeviceDataManagerTestApi().OnDeviceListsComplete(); |
Ahmed Fakhry | 607ade0 | 2019-10-31 15:59:39 | [diff] [blame] | 186 | ui::DeviceDataManagerTestApi().SetMouseDevices({}); |
| 187 | |
Mitsuru Oshima | a6adca4f | 2019-07-10 23:30:46 | [diff] [blame] | 188 | TabletMode::Waiter waiter(enable); |
Mitsuru Oshima | 9e05edd | 2019-06-17 19:35:39 | [diff] [blame] | 189 | shell_->tablet_mode_controller()->SetEnabledForTest(enable); |
Mitsuru Oshima | a6adca4f | 2019-07-10 23:30:46 | [diff] [blame] | 190 | waiter.Wait(); |
Evan Stade | d689b33 | 2018-08-02 01:17:22 | [diff] [blame] | 191 | } |
| 192 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 193 | void ShellTestApi::EnableVirtualKeyboard() { |
Darren Shen | 7daf3e1 | 2019-07-02 07:25:49 | [diff] [blame] | 194 | shell_->keyboard_controller()->SetEnableFlag( |
Darren Shen | 8604a21 | 2019-06-07 00:41:38 | [diff] [blame] | 195 | keyboard::KeyboardEnableFlag::kCommandLineEnabled); |
Noel Gordon | fe3ac34 | 2018-09-10 05:12:57 | [diff] [blame] | 196 | } |
| 197 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 198 | void ShellTestApi::ToggleFullscreen() { |
Manu Cornet | c3511d90 | 2020-01-10 22:44:43 | [diff] [blame] | 199 | accelerators::ToggleFullscreen(); |
Evan Stade | 7768d47 | 2018-10-25 22:40:17 | [diff] [blame] | 200 | } |
| 201 | |
Jun Mukai | aa8479c8 | 2019-01-08 02:30:39 | [diff] [blame] | 202 | void ShellTestApi::AddRemoveDisplay() { |
| 203 | shell_->display_manager()->AddRemoveDisplay(); |
| 204 | } |
| 205 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 206 | void ShellTestApi::WaitForNoPointerHoldLock() { |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 207 | aura::WindowTreeHost* primary_host = |
| 208 | Shell::GetPrimaryRootWindowController()->GetHost(); |
| 209 | if (primary_host->holding_pointer_moves()) |
| 210 | PointerMoveLoopWaiter(primary_host).Wait(); |
Scott Violet | d8ceadb | 2019-03-21 01:31:43 | [diff] [blame] | 211 | } |
| 212 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 213 | void ShellTestApi::WaitForNextFrame(base::OnceClosure closure) { |
Xiyuan Xia | 65d4bbf | 2019-04-08 15:13:38 | [diff] [blame] | 214 | Shell::GetPrimaryRootWindowController() |
| 215 | ->GetHost() |
| 216 | ->compositor() |
| 217 | ->RequestPresentationTimeForNextFrame(base::BindOnce( |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 218 | [](base::OnceClosure closure, |
Xiyuan Xia | 65d4bbf | 2019-04-08 15:13:38 | [diff] [blame] | 219 | const gfx::PresentationFeedback& feedback) { |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 220 | std::move(closure).Run(); |
Xiyuan Xia | 65d4bbf | 2019-04-08 15:13:38 | [diff] [blame] | 221 | }, |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 222 | std::move(closure))); |
Xiyuan Xia | 65d4bbf | 2019-04-08 15:13:38 | [diff] [blame] | 223 | } |
| 224 | |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 225 | void ShellTestApi::WaitForOverviewAnimationState(OverviewAnimationState state) { |
| 226 | auto* overview_controller = shell_->overview_controller(); |
| 227 | if (state == OverviewAnimationState::kEnterAnimationComplete && |
Sammie Quon | 2c85f73d | 2019-05-08 23:10:27 | [diff] [blame] | 228 | overview_controller->InOverviewSession() && |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 229 | !overview_controller->IsInStartAnimation()) { |
| 230 | // If there is no animation applied, call the callback immediately. |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 231 | return; |
| 232 | } |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 233 | if (state == OverviewAnimationState::kExitAnimationComplete && |
Sammie Quon | 2c85f73d | 2019-05-08 23:10:27 | [diff] [blame] | 234 | !overview_controller->InOverviewSession() && |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 235 | !overview_controller->IsCompletingShutdownAnimations()) { |
| 236 | // If there is no animation applied, call the callback immediately. |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 237 | return; |
| 238 | } |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 239 | base::RunLoop run_loop; |
Jun Mukai | 2b91e70 | 2019-09-05 18:24:38 | [diff] [blame] | 240 | new OverviewAnimationStateWaiter( |
Reilly Grant | b670223 | 2019-11-26 22:46:04 | [diff] [blame] | 241 | state, base::BindOnce([](base::RunLoop* run_loop, |
| 242 | bool finished) { run_loop->QuitWhenIdle(); }, |
| 243 | base::Unretained(&run_loop))); |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 244 | run_loop.Run(); |
Mitsuru Oshima | 57cc785 | 2019-04-10 00:15:27 | [diff] [blame] | 245 | } |
| 246 | |
Mitsuru Oshima | 77bfc27 | 2019-04-10 23:40:18 | [diff] [blame] | 247 | void ShellTestApi::WaitForLauncherAnimationState( |
Manu Cornet | c3511d90 | 2020-01-10 22:44:43 | [diff] [blame] | 248 | AppListViewState target_state) { |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 249 | base::RunLoop run_loop; |
Mitsuru Oshima | 9a6378d9 | 2019-11-01 00:48:15 | [diff] [blame] | 250 | WaitForLauncherState(target_state, run_loop.QuitWhenIdleClosure()); |
Jun Mukai | 4498638 | 2019-05-14 18:19:20 | [diff] [blame] | 251 | run_loop.Run(); |
Mitsuru Oshima | 77bfc27 | 2019-04-10 23:40:18 | [diff] [blame] | 252 | } |
| 253 | |
Sammie Quon | 358e957 | 2019-11-21 04:38:02 | [diff] [blame] | 254 | void ShellTestApi::WaitForWindowFinishAnimating(aura::Window* window) { |
| 255 | WindowAnimationWaiter waiter(window); |
| 256 | waiter.Wait(); |
| 257 | } |
| 258 | |
Toni Barzic | 8caccc8 | 2020-01-30 23:27:19 | [diff] [blame] | 259 | base::OnceClosure ShellTestApi::CreateWaiterForFinishingWindowAnimation( |
| 260 | aura::Window* window) { |
| 261 | auto waiter = std::make_unique<WindowAnimationWaiter>(window); |
| 262 | return base::BindOnce(&WindowAnimationWaiter::Wait, std::move(waiter)); |
| 263 | } |
| 264 | |
Jun Mukai | c9ba6b51 | 2019-06-05 19:21:42 | [diff] [blame] | 265 | PaginationModel* ShellTestApi::GetAppListPaginationModel() { |
Manu Cornet | 191c314 | 2019-10-09 06:31:32 | [diff] [blame] | 266 | AppListView* view = |
Jun Mukai | c9ba6b51 | 2019-06-05 19:21:42 | [diff] [blame] | 267 | Shell::Get()->app_list_controller()->presenter()->GetView(); |
| 268 | if (!view) |
| 269 | return nullptr; |
| 270 | return view->GetAppsPaginationModel(); |
| 271 | } |
| 272 | |
Sammie Quon | d322167b | 2021-01-11 22:10:40 | [diff] [blame] | 273 | bool ShellTestApi::IsContextMenuShown() const { |
| 274 | return Shell::GetPrimaryRootWindowController()->IsContextMenuShown(); |
| 275 | } |
| 276 | |
Alexander Alekseev | 2b4c959 | 2021-05-04 22:26:44 | [diff] [blame] | 277 | bool ShellTestApi::IsActionForAcceleratorEnabled( |
| 278 | const ui::Accelerator& accelerator) const { |
| 279 | return Shell::Get()->accelerator_controller()->IsActionForAcceleratorEnabled( |
| 280 | accelerator); |
| 281 | } |
| 282 | |
| 283 | bool ShellTestApi::PressAccelerator(const ui::Accelerator& accelerator) { |
| 284 | return Shell::Get()->accelerator_controller()->AcceleratorPressed( |
| 285 | accelerator); |
| 286 | } |
| 287 | |
| 288 | bool ShellTestApi::IsHUDShown() { |
| 289 | return hud_display::HUDDisplayView::IsShown(); |
| 290 | } |
| 291 | |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 292 | } // namespace ash |