| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/common/shell_observer.h" | 7 #include "ash/common/shell_observer.h" |
| 8 #include "ash/common/system/tray/system_tray_delegate.h" | 8 #include "ash/common/system/tray/system_tray_delegate.h" |
| 9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 EXPECT_EQ(1, screenshot_delegate->handle_take_screenshot_count()); | 162 EXPECT_EQ(1, screenshot_delegate->handle_take_screenshot_count()); |
| 163 SendKeyPressSync(ui::VKEY_PRINT, false, false, false); | 163 SendKeyPressSync(ui::VKEY_PRINT, false, false, false); |
| 164 EXPECT_EQ(2, screenshot_delegate->handle_take_screenshot_count()); | 164 EXPECT_EQ(2, screenshot_delegate->handle_take_screenshot_count()); |
| 165 SendKeyPressSync(ui::VKEY_MEDIA_LAUNCH_APP1, true, true, false); | 165 SendKeyPressSync(ui::VKEY_MEDIA_LAUNCH_APP1, true, true, false); |
| 166 EXPECT_EQ(2, screenshot_delegate->handle_take_screenshot_count()); | 166 EXPECT_EQ(2, screenshot_delegate->handle_take_screenshot_count()); |
| 167 // Press ESC to go out of the partial screenshot mode. | 167 // Press ESC to go out of the partial screenshot mode. |
| 168 SendKeyPressSync(ui::VKEY_ESCAPE, false, false, false); | 168 SendKeyPressSync(ui::VKEY_ESCAPE, false, false, false); |
| 169 | 169 |
| 170 // Test VOLUME_MUTE, VOLUME_DOWN, and VOLUME_UP. | 170 // Test VOLUME_MUTE, VOLUME_DOWN, and VOLUME_UP. |
| 171 TestVolumeControlDelegate* volume_delegate = new TestVolumeControlDelegate; | 171 TestVolumeControlDelegate* volume_delegate = new TestVolumeControlDelegate; |
| 172 shell()->system_tray_delegate()->SetVolumeControlDelegate( | 172 WmShell::Get()->system_tray_delegate()->SetVolumeControlDelegate( |
| 173 std::unique_ptr<VolumeControlDelegate>(volume_delegate)); | 173 std::unique_ptr<VolumeControlDelegate>(volume_delegate)); |
| 174 // VOLUME_MUTE. | 174 // VOLUME_MUTE. |
| 175 EXPECT_EQ(0, volume_delegate->handle_volume_mute_count()); | 175 EXPECT_EQ(0, volume_delegate->handle_volume_mute_count()); |
| 176 SendKeyPressSync(ui::VKEY_VOLUME_MUTE, false, false, false); | 176 SendKeyPressSync(ui::VKEY_VOLUME_MUTE, false, false, false); |
| 177 EXPECT_EQ(1, volume_delegate->handle_volume_mute_count()); | 177 EXPECT_EQ(1, volume_delegate->handle_volume_mute_count()); |
| 178 // VOLUME_DOWN. | 178 // VOLUME_DOWN. |
| 179 EXPECT_EQ(0, volume_delegate->handle_volume_down_count()); | 179 EXPECT_EQ(0, volume_delegate->handle_volume_down_count()); |
| 180 SendKeyPressSync(ui::VKEY_VOLUME_DOWN, false, false, false); | 180 SendKeyPressSync(ui::VKEY_VOLUME_DOWN, false, false, false); |
| 181 EXPECT_EQ(1, volume_delegate->handle_volume_down_count()); | 181 EXPECT_EQ(1, volume_delegate->handle_volume_down_count()); |
| 182 // VOLUME_UP. | 182 // VOLUME_UP. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 201 TEST_F(AcceleratorInteractiveUITest, MAYBE_ToggleAppList) { | 201 TEST_F(AcceleratorInteractiveUITest, MAYBE_ToggleAppList) { |
| 202 EXPECT_FALSE(shell()->GetAppListTargetVisibility()); | 202 EXPECT_FALSE(shell()->GetAppListTargetVisibility()); |
| 203 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); | 203 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); |
| 204 EXPECT_TRUE(shell()->GetAppListTargetVisibility()); | 204 EXPECT_TRUE(shell()->GetAppListTargetVisibility()); |
| 205 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); | 205 SendKeyPressSync(ui::VKEY_LWIN, false, false, false); |
| 206 EXPECT_FALSE(shell()->GetAppListTargetVisibility()); | 206 EXPECT_FALSE(shell()->GetAppListTargetVisibility()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace test | 209 } // namespace test |
| 210 } // namespace ash | 210 } // namespace ash |
| OLD | NEW |