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

Unified Diff: trunk/src/ash/wm/power_button_controller_unittest.cc

Issue 14200034: Revert 194578 "Add ash SessionStateDelegate" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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: trunk/src/ash/wm/power_button_controller_unittest.cc
===================================================================
--- trunk/src/ash/wm/power_button_controller_unittest.cc (revision 194588)
+++ trunk/src/ash/wm/power_button_controller_unittest.cc (working copy)
@@ -8,7 +8,6 @@
#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"
@@ -78,7 +77,6 @@
animator_.get()));
shell_delegate_ = reinterpret_cast<TestShellDelegate*>(
ash::Shell::GetInstance()->delegate());
- state_delegate_ = Shell::GetInstance()->session_state_delegate();
}
protected:
@@ -97,7 +95,6 @@
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_;
@@ -142,7 +139,7 @@
// Notify that the lock window is visible. We should make it fade in.
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
@@ -308,7 +305,7 @@
// Notify that the lock window is visible. We should make it fade in.
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::kAllLockScreenContainersMask,
@@ -323,7 +320,7 @@
// Notify that the screen has been unlocked. We should show the
// non-screen-locker windows.
state_controller_->OnLockStateChanged(false);
- state_delegate_->UnlockScreen();
+ shell_delegate_->UnlockScreen();
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
internal::SessionStateAnimator::DESKTOP_BACKGROUND |
@@ -344,7 +341,7 @@
test_api_->trigger_lock_timeout();
state_controller_->OnStartingLock();
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
// When the lock-to-shutdown timeout fires, we should start the shutdown
// timer.
@@ -382,7 +379,7 @@
// Power button is released while system attempts to lock.
controller_->OnPowerButtonEvent(false, base::TimeTicks::Now());
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
EXPECT_FALSE(state_controller_->ShutdownRequested());
EXPECT_FALSE(test_api_->lock_to_shutdown_timer_is_running());
@@ -482,7 +479,7 @@
// Pressing the button also shouldn't do anything after the screen is locked.
state_controller_->OnStartingLock();
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
controller_->OnLockButtonEvent(true, base::TimeTicks::Now());
EXPECT_FALSE(test_api_->lock_timer_is_running());
controller_->OnLockButtonEvent(false, base::TimeTicks::Now());
@@ -571,7 +568,7 @@
TEST_F(PowerButtonControllerTest, RequestShutdownFromLockScreen) {
state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER);
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
state_controller_->RequestShutdown();
EXPECT_TRUE(
animator_api_->ContainersAreAnimated(
@@ -593,7 +590,7 @@
TEST_F(PowerButtonControllerTest, RequestAndCancelShutdownFromLockScreen) {
state_controller_->OnLoginStateChanged(user::LOGGED_IN_USER);
state_controller_->OnLockStateChanged(true);
- state_delegate_->LockScreen();
+ shell_delegate_->LockScreen();
// Press the power button and check that we start the shutdown timer.
controller_->OnPowerButtonEvent(true, base::TimeTicks::Now());
« no previous file with comments | « trunk/src/ash/wm/power_button_controller.cc ('k') | trunk/src/ash/wm/session_state_controller_impl2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698