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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 #include "ash/caps_lock_delegate.h" | 6 #include "ash/caps_lock_delegate.h" |
7 #include "ash/ime/event.h" | 7 #include "ash/ime/event.h" |
8 #include "ash/screenshot_delegate.h" | 8 #include "ash/screenshot_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 EXPECT_TRUE(GetController()->Process( | 272 EXPECT_TRUE(GetController()->Process( |
273 ui::Accelerator(ui::VKEY_TAB, false, false, true))); | 273 ui::Accelerator(ui::VKEY_TAB, false, false, true))); |
274 // TakeScreenshot | 274 // TakeScreenshot |
275 // True should always be returned regardless of the existence of the delegate. | 275 // True should always be returned regardless of the existence of the delegate. |
276 { | 276 { |
277 EXPECT_TRUE(GetController()->Process( | 277 EXPECT_TRUE(GetController()->Process( |
278 ui::Accelerator(ui::VKEY_F5, false, true, false))); | 278 ui::Accelerator(ui::VKEY_F5, false, true, false))); |
279 EXPECT_TRUE(GetController()->Process( | 279 EXPECT_TRUE(GetController()->Process( |
280 ui::Accelerator(ui::VKEY_PRINT, false, false, false))); | 280 ui::Accelerator(ui::VKEY_PRINT, false, false, false))); |
281 DummyScreenshotDelegate* delegate = new DummyScreenshotDelegate; | 281 DummyScreenshotDelegate* delegate = new DummyScreenshotDelegate; |
282 GetController()->SetScreenshotDelegate(delegate); | 282 GetController()->SetScreenshotDelegate( |
| 283 scoped_ptr<ScreenshotDelegate>(delegate).Pass()); |
283 EXPECT_EQ(0, delegate->handle_take_screenshot_count()); | 284 EXPECT_EQ(0, delegate->handle_take_screenshot_count()); |
284 EXPECT_TRUE(GetController()->Process( | 285 EXPECT_TRUE(GetController()->Process( |
285 ui::Accelerator(ui::VKEY_F5, false, true, false))); | 286 ui::Accelerator(ui::VKEY_F5, false, true, false))); |
286 EXPECT_EQ(1, delegate->handle_take_screenshot_count()); | 287 EXPECT_EQ(1, delegate->handle_take_screenshot_count()); |
287 EXPECT_TRUE(GetController()->Process( | 288 EXPECT_TRUE(GetController()->Process( |
288 ui::Accelerator(ui::VKEY_PRINT, false, false, false))); | 289 ui::Accelerator(ui::VKEY_PRINT, false, false, false))); |
289 EXPECT_EQ(2, delegate->handle_take_screenshot_count()); | 290 EXPECT_EQ(2, delegate->handle_take_screenshot_count()); |
290 } | 291 } |
291 // ToggleCapsLock | 292 // ToggleCapsLock |
292 { | 293 { |
(...skipping 23 matching lines...) Expand all Loading... |
316 #if !defined(OS_LINUX) | 317 #if !defined(OS_LINUX) |
317 // ToggleDesktopFullScreen (not implemented yet on Linux) | 318 // ToggleDesktopFullScreen (not implemented yet on Linux) |
318 EXPECT_TRUE(GetController()->Process( | 319 EXPECT_TRUE(GetController()->Process( |
319 ui::Accelerator(ui::VKEY_F11, false, true, false))); | 320 ui::Accelerator(ui::VKEY_F11, false, true, false))); |
320 #endif | 321 #endif |
321 #endif | 322 #endif |
322 } | 323 } |
323 | 324 |
324 } // namespace test | 325 } // namespace test |
325 } // namespace ash | 326 } // namespace ash |
OLD | NEW |