Chromium Code Reviews| Index: ash/wm/power_button_controller_unittest.cc |
| diff --git a/ash/wm/power_button_controller_unittest.cc b/ash/wm/power_button_controller_unittest.cc |
| index b84a0717c6ddd56a4854332de9f6a2291b03334b..275ed3e0b2a8a6703560e39ae94d128a08b0ff25 100644 |
| --- a/ash/wm/power_button_controller_unittest.cc |
| +++ b/ash/wm/power_button_controller_unittest.cc |
| @@ -84,7 +84,7 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) { |
| controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_FALSE(test_api_->hide_background_layer_timer_is_running()); |
| @@ -95,18 +95,18 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) { |
| controller_->OnStartingLock(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_CONTAINERS, |
| + PowerButtonController::LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_HIDE)); |
| // Notify that the lock window is visible. We should make it fade in. |
| controller_->OnLockStateChanged(true); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FADE_IN)); |
| // We shouldn't progress towards the shutdown state, however. |
| @@ -117,9 +117,18 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) { |
| // Hold the button again and check that we start shutting down. |
| controller_->OnPowerButtonEvent(true, base::TimeTicks::Now()); |
| EXPECT_EQ(0, delegate_->num_shutdown_requests()); |
| + // Previously we're checking that all containers group was animated which |
|
Daniel Erat
2012/09/04 16:40:18
nit: add a blank line before this
s/all container
Nikita (slow)
2012/09/04 17:36:42
Done.
|
| + // was in fact checking that |
| + // 1. All user session containers have transform (including wallpaper). |
| + // They're in this state after lock. |
| + // 2. Screen locker and related containers are in fact animating |
| + // (as shutdown is in progress). |
| + // With http://crbug.com/144737 we no longer animate user session wallpaper |
| + // during lock so it makes sense only to check that screen lock and related |
| + // containers are animated during shutdown. |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_FALSE(cursor_visible()); |
| EXPECT_TRUE(test_api_->real_shutdown_timer_is_running()); |
| @@ -161,7 +170,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) { |
| EXPECT_TRUE(test_api_->shutdown_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_CONTAINERS, |
| + PowerButtonController::GetAllContainersMask(), |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| @@ -170,7 +179,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) { |
| EXPECT_FALSE(test_api_->shutdown_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_CONTAINERS, |
| + PowerButtonController::GetAllContainersMask(), |
| PowerButtonController::ANIMATION_UNDO_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| @@ -189,11 +198,11 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) { |
| EXPECT_EQ(0, delegate_->num_shutdown_requests()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_HIDE)); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| // When the timout fires, we should request a shutdown. |
| @@ -213,7 +222,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| // logging-in animation. |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_CONTAINERS, |
| + PowerButtonController::LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_RESTORE)); |
| // Press the power button and check that the lock timer is started and that we |
| @@ -223,7 +232,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| EXPECT_FALSE(test_api_->shutdown_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| @@ -232,7 +241,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| EXPECT_FALSE(test_api_->lock_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_UNDO_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_TRUE(test_api_->hide_background_layer_timer_is_running()); |
| @@ -248,7 +257,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| EXPECT_EQ(1, delegate_->num_lock_requests()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| @@ -256,18 +265,18 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| controller_->OnStartingLock(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_CONTAINERS, |
| + PowerButtonController::LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_HIDE)); |
| // Notify that the lock window is visible. We should make it fade in. |
| controller_->OnLockStateChanged(true); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FADE_IN)); |
| // When we release the power button, the lock-to-shutdown timer should be |
| @@ -281,7 +290,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) { |
| controller_->OnLockStateChanged(false); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_RESTORE)); |
| EXPECT_FALSE(test_api_->BackgroundLayerIsVisible()); |
| } |
| @@ -307,7 +316,7 @@ TEST_F(PowerButtonControllerTest, LockToShutdown) { |
| EXPECT_TRUE(test_api_->shutdown_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_CONTAINERS, |
| + PowerButtonController::GetAllContainersMask(), |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| // Fire the shutdown timeout and check that we request shutdown. |
| @@ -333,7 +342,7 @@ TEST_F(PowerButtonControllerTest, LockFail) { |
| EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_RESTORE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| test_api_->trigger_lock_timeout(); |
| @@ -348,7 +357,7 @@ TEST_F(PowerButtonControllerTest, LockFail) { |
| test_api_->trigger_lock_fail_timeout(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_RESTORE)); |
| EXPECT_FALSE(test_api_->BackgroundLayerIsVisible()); |
| } |
| @@ -395,7 +404,7 @@ TEST_F(PowerButtonControllerTest, LockButtonBasic) { |
| EXPECT_TRUE(test_api_->lock_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| @@ -404,7 +413,7 @@ TEST_F(PowerButtonControllerTest, LockButtonBasic) { |
| EXPECT_FALSE(test_api_->lock_timer_is_running()); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_UNDO_SLOW_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_TRUE(test_api_->hide_background_layer_timer_is_running()); |
| @@ -473,7 +482,7 @@ TEST_F(PowerButtonControllerTest, LockWithoutButton) { |
| controller_->OnStartingLock(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| } |
| @@ -485,7 +494,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWithoutButton) { |
| controller_->OnAppTerminating(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_CONTAINERS, |
| + PowerButtonController::GetAllContainersMask(), |
| PowerButtonController::ANIMATION_HIDE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_FALSE(cursor_visible()); |
| @@ -498,11 +507,11 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLoginScreen) { |
| controller_->RequestShutdown(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_HIDE)); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_FALSE(cursor_visible()); |
| @@ -519,11 +528,11 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) { |
| controller_->RequestShutdown(); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::ALL_BUT_SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::NON_LOCK_SCREEN_CONTAINERS, |
| PowerButtonController::ANIMATION_HIDE)); |
| EXPECT_TRUE( |
| test_api_->ContainerGroupIsAnimated( |
| - PowerButtonController::SCREEN_LOCKER_AND_RELATED_CONTAINERS, |
| + PowerButtonController::GetAllScreenLockContainersMask(), |
| PowerButtonController::ANIMATION_FAST_CLOSE)); |
| EXPECT_TRUE(test_api_->BackgroundLayerIsVisible()); |
| EXPECT_FALSE(cursor_visible()); |