Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2559)

Unified Diff: ash/wm/power_button_controller_unittest.cc

Issue 11220002: Add new animations in second implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added shutdown animations Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c8eb348ea7ae77791c647fc172c90a061cae0e06..afc9f7d20f6a552a2145ce3dad6813e9cb61b953 100644
--- a/ash/wm/power_button_controller_unittest.cc
+++ b/ash/wm/power_button_controller_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/wm/power_button_controller.h"
#include "ash/wm/session_state_animator.h"
#include "ash/wm/session_state_controller.h"
+#include "ash/wm/session_state_controller_impl.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
@@ -62,9 +63,10 @@ class PowerButtonControllerTest : public AshTestBase {
AshTestBase::SetUp();
delegate_ = new TestPowerButtonControllerDelegate;
controller_ = Shell::GetInstance()->power_button_controller();
- state_controller_ = Shell::GetInstance()->session_state_controller();
+ state_controller_ = reinterpret_cast<SessionStateControllerImpl*>(
+ Shell::GetInstance()->session_state_controller());
state_controller_->SetDelegate(delegate_); // transfers ownership
- test_api_.reset(new SessionStateController::TestApi(state_controller_));
+ test_api_.reset(new SessionStateControllerImpl::TestApi(state_controller_));
animator_api_.reset(
new internal::SessionStateAnimator::TestApi(state_controller_->
animator_.get()));
@@ -84,10 +86,10 @@ class PowerButtonControllerTest : public AshTestBase {
}
PowerButtonController* controller_; // not owned
- SessionStateController* state_controller_; // not owned
+ SessionStateControllerImpl* state_controller_; // not owned
TestPowerButtonControllerDelegate* delegate_; // not owned
- scoped_ptr<SessionStateController::TestApi> test_api_;
+ scoped_ptr<SessionStateControllerImpl::TestApi> test_api_;
scoped_ptr<internal::SessionStateAnimator::TestApi> animator_api_;
private:
@@ -109,7 +111,7 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
EXPECT_FALSE(animator_api_->hide_black_layer_timer_is_running());
EXPECT_FALSE(test_api_->lock_timer_is_running());
@@ -124,7 +126,7 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS,
@@ -158,7 +160,7 @@ TEST_F(PowerButtonControllerTest, LegacyLockAndShutDown) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
// Make sure a mouse move event won't show the cursor.
GenerateMouseMoveEvent();
EXPECT_FALSE(cursor_visible());
@@ -202,7 +204,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllContainersMask,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// Release the power button before the shutdown timer fires.
@@ -211,7 +213,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllContainersMask,
- internal::SessionStateAnimator::ANIMATION_UNDO_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// We should re-hide the black layer after waiting long enough for
@@ -235,7 +237,7 @@ TEST_F(PowerButtonControllerTest, ShutdownWhenNotLoggedIn) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
// When the timout fires, we should request a shutdown.
test_api_->trigger_real_shutdown_timeout();
@@ -265,7 +267,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// Release the button before the lock timer fires.
@@ -274,7 +276,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_UNDO_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
EXPECT_TRUE(animator_api_->hide_black_layer_timer_is_running());
animator_api_->TriggerHideBlackLayerTimeout();
@@ -290,7 +292,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// Notify that we locked successfully.
@@ -302,7 +304,7 @@ TEST_F(PowerButtonControllerTest, LockAndUnlock) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS,
@@ -355,7 +357,7 @@ TEST_F(PowerButtonControllerTest, LockToShutdown) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllContainersMask,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
// Fire the shutdown timeout and check that we request shutdown.
test_api_->trigger_shutdown_timeout();
@@ -469,7 +471,7 @@ TEST_F(PowerButtonControllerTest, LockButtonBasic) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// If the button is released immediately, we shouldn't lock the screen.
@@ -478,7 +480,7 @@ TEST_F(PowerButtonControllerTest, LockButtonBasic) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_UNDO_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
EXPECT_TRUE(animator_api_->hide_black_layer_timer_is_running());
animator_api_->TriggerHideBlackLayerTimeout();
@@ -547,7 +549,7 @@ TEST_F(PowerButtonControllerTest, LockWithoutButton) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
}
@@ -577,7 +579,7 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLoginScreen) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
GenerateMouseMoveEvent();
EXPECT_FALSE(cursor_visible());
@@ -599,7 +601,7 @@ TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
- internal::SessionStateAnimator::ANIMATION_FAST_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_FULL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
GenerateMouseMoveEvent();
EXPECT_FALSE(cursor_visible());
@@ -621,7 +623,7 @@ TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllContainersMask,
- internal::SessionStateAnimator::ANIMATION_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_PARTIAL_CLOSE));
EXPECT_TRUE(animator_api_->BlackLayerIsVisible());
// Release the power button before the shutdown timer fires.
@@ -630,7 +632,7 @@ TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) {
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
- internal::SessionStateAnimator::ANIMATION_UNDO_SLOW_CLOSE));
+ internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_CLOSE));
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::DESKTOP_BACKGROUND,

Powered by Google App Engine
This is Rietveld 408576698