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

Unified Diff: ash/common/session/session_controller_unittest.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 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/common/session/session_controller_unittest.cc
diff --git a/ash/common/session/session_controller_unittest.cc b/ash/common/session/session_controller_unittest.cc
index d6a986a6833d412ffb68fd7bca53b327c9a78655..05881ee36a9c356195adf67301a8a8515c39ae09 100644
--- a/ash/common/session/session_controller_unittest.cc
+++ b/ash/common/session/session_controller_unittest.cc
@@ -126,9 +126,15 @@ TEST_F(SessionControllerTest, SimpleSessionInfo) {
EXPECT_EQ(session_manager::kMaxmiumNumberOfUserSessions,
controller()->GetMaximumNumberOfLoggedInUsers());
- EXPECT_TRUE(controller()->CanLockScreen());
EXPECT_TRUE(controller()->ShouldLockScreenAutomatically());
+ // Cannot lock screen when there is no active user session.
James Cook 2017/03/17 17:14:35 nit: Put this in a separate test case.
xiyuan 2017/03/17 22:52:02 Done.
+ EXPECT_FALSE(controller()->IsActiveUserSessionStarted());
+ EXPECT_FALSE(controller()->CanLockScreen());
+ UpdateSession(1u, "user1@test.com");
+ EXPECT_TRUE(controller()->IsActiveUserSessionStarted());
+ EXPECT_TRUE(controller()->CanLockScreen());
+
info.can_lock_screen = false;
SetSessionInfo(info);
EXPECT_FALSE(controller()->CanLockScreen());

Powered by Google App Engine
This is Rietveld 408576698