| 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.
|
|
|