diff options
Diffstat (limited to 'ash/wm/power_button_controller_unittest.cc')
-rw-r--r-- | ash/wm/power_button_controller_unittest.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ash/wm/power_button_controller_unittest.cc b/ash/wm/power_button_controller_unittest.cc index a989644..7dbdf73 100644 --- a/ash/wm/power_button_controller_unittest.cc +++ b/ash/wm/power_button_controller_unittest.cc @@ -8,6 +8,7 @@ #include "ash/wm/session_state_controller_impl.h" #include "ash/ash_switches.h" +#include "ash/session_state_delegate.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_shell_delegate.h" @@ -77,6 +78,7 @@ class PowerButtonControllerTest : public AshTestBase { animator_.get())); shell_delegate_ = reinterpret_cast<TestShellDelegate*>( ash::Shell::GetInstance()->delegate()); + state_delegate_ = Shell::GetInstance()->session_state_delegate(); } protected: @@ -95,6 +97,7 @@ class PowerButtonControllerTest : public AshTestBase { SessionStateControllerImpl* state_controller_; // not owned TestPowerButtonControllerDelegate* delegate_; // not owned TestShellDelegate* shell_delegate_; // not owned + SessionStateDelegate* state_delegate_; // not owned scoped_ptr<SessionStateControllerImpl::TestApi> test_api_; scoped_ptr<internal::SessionStateAnimator::TestApi> animator_api_; @@ -139,7 +142,7 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) { // Notify that the lock window is visible. We should make it fade in. state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); EXPECT_TRUE( animator_api_->ContainersAreAnimated( internal::SessionStateAnimator::kAllLockScreenContainersMask, @@ -305,7 +308,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { // Notify that the lock window is visible. We should make it fade in. state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); EXPECT_TRUE( animator_api_->ContainersAreAnimated( internal::SessionStateAnimator::kAllLockScreenContainersMask, @@ -320,7 +323,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { // Notify that the screen has been unlocked. We should show the // non-screen-locker windows. state_controller_->OnLockStateChanged(false); - shell_delegate_->UnlockScreen(); + state_delegate_->UnlockScreen(); EXPECT_TRUE( animator_api_->ContainersAreAnimated( internal::SessionStateAnimator::DESKTOP_BACKGROUND | @@ -341,7 +344,7 @@ TEST_F(PowerButtonControllerTest, LockToShutdown) { test_api_->trigger_lock_timeout(); state_controller_->OnStartingLock(); state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); // When the lock-to-shutdown timeout fires, we should start the shutdown // timer. @@ -379,7 +382,7 @@ TEST_F(PowerButtonControllerTest, CancelLockToShutdown) { // Power button is released while system attempts to lock. controller_->OnPowerButtonEvent(false, base::TimeTicks::Now()); state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); EXPECT_FALSE(state_controller_->ShutdownRequested()); EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running()); @@ -479,7 +482,7 @@ TEST_F(PowerButtonControllerTest, LockButtonBasic) { // Pressing the button also shouldn't do anything after the screen is locked. state_controller_->OnStartingLock(); state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); controller_->OnLockButtonEvent(true, base::TimeTicks::Now()); EXPECT_FALSE(test_api_->lock_timer_is_running()); controller_->OnLockButtonEvent(false, base::TimeTicks::Now()); @@ -568,7 +571,7 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLoginScreen) { TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) { state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); state_controller_->RequestShutdown(); EXPECT_TRUE( animator_api_->ContainersAreAnimated( @@ -590,7 +593,7 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) { TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) { state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER); state_controller_->OnLockStateChanged(true); - shell_delegate_->LockScreen(); + state_delegate_->LockScreen(); // Press the power button and check that we start the shutdown timer. controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |