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

Unified Diff: chrome/browser/chromeos/login/existing_user_controller_browsertest.cc

Issue 2835473002: Chromad: Allow offline login. (Closed)
Patch Set: Add TryAuthenticateUser call Created 3 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: chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
index d26d2d2134738d6050afb469fbb3031088748545..16c3aae13199e075626fe40c7c975b348888bafe 100644
--- a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
@@ -796,6 +796,7 @@ class ExistingUserControllerActiveDirectoryTest
.Times(1);
EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)).Times(1);
}
+
void ExpectLoginSuccess() {
EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)).Times(2);
EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)).Times(1);
@@ -823,16 +824,24 @@ IN_PROC_BROWSER_TEST_F(ExistingUserControllerActiveDirectoryTest,
content::RunAllPendingInMessageLoop();
}
-// Tests that Active Directory offline login fails on the Active Directory
+// Tests that Active Directory offline login succeeds on the Active Directory
// managed device.
IN_PROC_BROWSER_TEST_F(ExistingUserControllerActiveDirectoryTest,
- ActiveDirectoryOfflineLogin_Failure) {
- ExpectLoginFailure();
+ ActiveDirectoryOfflineLogin_Success) {
+ ExpectLoginSuccess();
UserContext user_context(ad_account_id_);
user_context.SetKey(Key(kPassword));
user_context.SetUserIDHash(ad_account_id_.GetUserEmail());
user_context.SetUserType(user_manager::UserType::USER_TYPE_ACTIVE_DIRECTORY);
+ content::WindowedNotificationObserver profile_prepared_observer(
+ chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
+ content::NotificationService::AllSources());
existing_user_controller()->Login(user_context, SigninSpecifics());
+
+ profile_prepared_observer.Wait();
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ClearNotifications));
+ content::RunAllPendingInMessageLoop();
}
// Tests that Gaia login fails on the Active Directory managed device.

Powered by Google App Engine
This is Rietveld 408576698