Commit 5f93c62c authored by chcunningham's avatar chcunningham Committed by Commit Bot

Signin for UserPolicy Signin/Signout Tests

Adds call to SigninManager::SignIn(...) as part of TestSuccessfulSignin
helper method. This is needed to simulate real signin and becomes
critical with upcoming changes* to FakeSigninManager.

*https://chromium-review.googlesource.com/c/chromium/src/+/1154985

Bug: 806781
Change-Id: I973859ef52bcddd978429dbb4ce9d913224c7b0d
Reviewed-on: https://chromium-review.googlesource.com/1160492
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580194}
parent 1570e063
...@@ -281,6 +281,9 @@ class UserPolicySigninServiceTest : public testing::Test { ...@@ -281,6 +281,9 @@ class UserPolicySigninServiceTest : public testing::Test {
EXPECT_CALL(*this, OnPolicyRefresh(true)).Times(0); EXPECT_CALL(*this, OnPolicyRefresh(true)).Times(0);
RegisterPolicyClientWithCallback(signin_service); RegisterPolicyClientWithCallback(signin_service);
// Sign in to Chrome.
signin_manager_->SignIn(kTestGaiaId, kTestUser, "");
// Mimic successful oauth token fetch. // Mimic successful oauth token fetch.
MakeOAuthTokenFetchSucceed(); MakeOAuthTokenFetchSucceed();
...@@ -433,7 +436,7 @@ TEST_F(UserPolicySigninServiceTest, InitRefreshTokenAvailableBeforeSignin) { ...@@ -433,7 +436,7 @@ TEST_F(UserPolicySigninServiceTest, InitRefreshTokenAvailableBeforeSignin) {
profile_.get()->GetPrefs(), kTestGaiaId, kTestUser); profile_.get()->GetPrefs(), kTestGaiaId, kTestUser);
GetTokenService()->UpdateCredentials(account_id, "oauth_login_refresh_token"); GetTokenService()->UpdateCredentials(account_id, "oauth_login_refresh_token");
// Not ssigned in yet, so client registration should be deferred. // Not signed in yet, so client registration should be deferred.
ASSERT_FALSE(IsRequestActive()); ASSERT_FALSE(IsRequestActive());
// Sign in to Chrome. // Sign in to Chrome.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment