| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/lock_state_controller.h" | 5 #include "ash/wm/lock_state_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 SCOPED_TRACE("Failure in ExpectRestoringWallpaperVisibility"); | 270 SCOPED_TRACE("Failure in ExpectRestoringWallpaperVisibility"); |
| 271 EXPECT_LT(0u, test_animator_->GetAnimationCount()); | 271 EXPECT_LT(0u, test_animator_->GetAnimationCount()); |
| 272 EXPECT_TRUE(test_animator_->AreContainersAnimated( | 272 EXPECT_TRUE(test_animator_->AreContainersAnimated( |
| 273 SessionStateAnimator::WALLPAPER, | 273 SessionStateAnimator::WALLPAPER, |
| 274 SessionStateAnimator::ANIMATION_FADE_IN)); | 274 SessionStateAnimator::ANIMATION_FADE_IN)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void ExpectUnlockedState() { | 277 void ExpectUnlockedState() { |
| 278 SCOPED_TRACE("Failure in ExpectUnlockedState"); | 278 SCOPED_TRACE("Failure in ExpectUnlockedState"); |
| 279 EXPECT_EQ(0u, test_animator_->GetAnimationCount()); | 279 EXPECT_EQ(0u, test_animator_->GetAnimationCount()); |
| 280 EXPECT_FALSE(WmShell::Get()->session_controller()->IsScreenLocked()); | 280 EXPECT_FALSE(Shell::Get()->session_controller()->IsScreenLocked()); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void ExpectLockedState() { | 283 void ExpectLockedState() { |
| 284 SCOPED_TRACE("Failure in ExpectLockedState"); | 284 SCOPED_TRACE("Failure in ExpectLockedState"); |
| 285 EXPECT_EQ(0u, test_animator_->GetAnimationCount()); | 285 EXPECT_EQ(0u, test_animator_->GetAnimationCount()); |
| 286 EXPECT_TRUE(WmShell::Get()->session_controller()->IsScreenLocked()); | 286 EXPECT_TRUE(Shell::Get()->session_controller()->IsScreenLocked()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void HideWallpaper() { test_animator_->HideWallpaper(); } | 289 void HideWallpaper() { test_animator_->HideWallpaper(); } |
| 290 | 290 |
| 291 void PressPowerButton() { | 291 void PressPowerButton() { |
| 292 power_button_controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); | 292 power_button_controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void ReleasePowerButton() { | 295 void ReleasePowerButton() { |
| 296 power_button_controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); | 296 power_button_controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 307 void PressVolumeDown() { | 307 void PressVolumeDown() { |
| 308 GetEventGenerator().PressKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); | 308 GetEventGenerator().PressKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void ReleaseVolumeDown() { | 311 void ReleaseVolumeDown() { |
| 312 GetEventGenerator().ReleaseKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); | 312 GetEventGenerator().ReleaseKey(ui::VKEY_VOLUME_DOWN, ui::EF_NONE); |
| 313 } | 313 } |
| 314 | 314 |
| 315 void SystemLocks() { | 315 void SystemLocks() { |
| 316 lock_state_controller_->OnLockStateChanged(true); | 316 lock_state_controller_->OnLockStateChanged(true); |
| 317 WmShell::Get()->session_controller()->LockScreenAndFlushForTest(); | 317 Shell::Get()->session_controller()->LockScreenAndFlushForTest(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 void SuccessfulAuthentication(bool* call_flag) { | 320 void SuccessfulAuthentication(bool* call_flag) { |
| 321 base::Closure closure = base::Bind(&CheckCalledCallback, call_flag); | 321 base::Closure closure = base::Bind(&CheckCalledCallback, call_flag); |
| 322 lock_state_controller_->OnLockScreenHide(closure); | 322 lock_state_controller_->OnLockScreenHide(closure); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void SystemUnlocks() { | 325 void SystemUnlocks() { |
| 326 lock_state_controller_->OnLockStateChanged(false); | 326 lock_state_controller_->OnLockStateChanged(false); |
| 327 GetSessionControllerClient()->UnlockScreen(); | 327 GetSessionControllerClient()->UnlockScreen(); |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 ASSERT_EQ(0, delegate->handle_take_screenshot_count()); | 1074 ASSERT_EQ(0, delegate->handle_take_screenshot_count()); |
| 1075 PressVolumeDown(); | 1075 PressVolumeDown(); |
| 1076 PressPowerButton(); | 1076 PressPowerButton(); |
| 1077 ReleasePowerButton(); | 1077 ReleasePowerButton(); |
| 1078 ReleaseVolumeDown(); | 1078 ReleaseVolumeDown(); |
| 1079 EXPECT_EQ(1, delegate->handle_take_screenshot_count()); | 1079 EXPECT_EQ(1, delegate->handle_take_screenshot_count()); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 } // namespace test | 1082 } // namespace test |
| 1083 } // namespace ash | 1083 } // namespace ash |
| OLD | NEW |