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

Unified Diff: ash/wm/lock_state_controller_unittest.cc

Issue 2111443002: mash: Migrate SessionStateDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 6 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/lock_state_controller_unittest.cc
diff --git a/ash/wm/lock_state_controller_unittest.cc b/ash/wm/lock_state_controller_unittest.cc
index f66af249c0545f15db94580bc87be3f9a3ce2378..67ea175584cc3d5770848ac40c3e10421e2fb7ea 100644
--- a/ash/wm/lock_state_controller_unittest.cc
+++ b/ash/wm/lock_state_controller_unittest.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/wm_shell.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/test_lock_state_controller_delegate.h"
@@ -33,7 +34,7 @@ namespace test {
namespace {
bool cursor_visible() {
- return ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible();
+ return Shell::GetInstance()->cursor_manager()->IsCursorVisible();
}
void CheckCalledCallback(bool* flag) {
@@ -67,10 +68,9 @@ class LockStateControllerTest : public AshTestBase {
test_api_.reset(new LockStateController::TestApi(lock_state_controller_));
power_button_controller_ = Shell::GetInstance()->power_button_controller();
- session_state_delegate_ = Shell::GetInstance()->session_state_delegate();
- shell_delegate_ = reinterpret_cast<TestShellDelegate*>(
- ash::Shell::GetInstance()->delegate());
+ shell_delegate_ =
+ static_cast<TestShellDelegate*>(Shell::GetInstance()->delegate());
}
protected:
@@ -250,13 +250,13 @@ class LockStateControllerTest : public AshTestBase {
void ExpectUnlockedState() {
SCOPED_TRACE("Failure in ExpectUnlockedState");
EXPECT_EQ(0u, test_animator_->GetAnimationCount());
- EXPECT_FALSE(session_state_delegate_->IsScreenLocked());
+ EXPECT_FALSE(WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked());
}
void ExpectLockedState() {
SCOPED_TRACE("Failure in ExpectLockedState");
EXPECT_EQ(0u, test_animator_->GetAnimationCount());
- EXPECT_TRUE(session_state_delegate_->IsScreenLocked());
+ EXPECT_TRUE(WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked());
}
void HideBackground() { test_animator_->HideBackground(); }
@@ -287,7 +287,7 @@ class LockStateControllerTest : public AshTestBase {
void SystemLocks() {
lock_state_controller_->OnLockStateChanged(true);
- session_state_delegate_->LockScreen();
+ WmShell::Get()->GetSessionStateDelegate()->LockScreen();
}
void SuccessfulAuthentication(bool* call_flag) {
@@ -297,7 +297,7 @@ class LockStateControllerTest : public AshTestBase {
void SystemUnlocks() {
lock_state_controller_->OnLockStateChanged(false);
- session_state_delegate_->UnlockScreen();
+ WmShell::Get()->GetSessionStateDelegate()->UnlockScreen();
}
void EnableMaximizeMode(bool enable) {
@@ -321,7 +321,6 @@ class LockStateControllerTest : public AshTestBase {
TestLockStateControllerDelegate*
lock_state_controller_delegate_; // not owned
TestSessionStateAnimator* test_animator_; // not owned
- SessionStateDelegate* session_state_delegate_; // not owned
std::unique_ptr<LockStateController::TestApi> test_api_;
TestShellDelegate* shell_delegate_; // not owned

Powered by Google App Engine
This is Rietveld 408576698