Chromium Code Reviews| Index: chrome/browser/chromeos/login/signin/oauth2_browsertest.cc |
| diff --git a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc |
| index 46b7816dd6c021a7dd670443cedc1b99cf859dc5..182a663c69028abdec7282f07390495131cf525b 100644 |
| --- a/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc |
| +++ b/chrome/browser/chromeos/login/signin/oauth2_browsertest.cc |
| @@ -587,6 +587,34 @@ IN_PROC_BROWSER_TEST_F(OAuth2Test, DISABLED_OverlappingContinueSessionRestore) { |
| EXPECT_TRUE(token_service->RefreshTokenIsAvailable(account_id)); |
| } |
| +IN_PROC_BROWSER_TEST_F(OAuth2Test, TerminateOnBadMergeSessionAfterOnlineAuth) { |
|
achuithb
2017/05/25 19:44:17
Let's add a comment and a link to the bug
xiyuan
2017/05/25 20:24:10
Done.
|
| + SimulateNetworkOnline(); |
| + WaitForGaiaPageLoad(); |
| + |
| + content::WindowedNotificationObserver termination_waiter( |
| + chrome::NOTIFICATION_APP_TERMINATING, |
| + content::NotificationService::AllSources()); |
| + |
| + // Configure FakeGaia so that online auth succeeds but merge session fails. |
| + FakeGaia::MergeSessionParams params; |
| + params.auth_sid_cookie = kTestAuthSIDCookie; |
| + params.auth_lsid_cookie = kTestAuthLSIDCookie; |
| + params.auth_code = kTestAuthCode; |
| + params.refresh_token = kTestRefreshToken; |
| + params.access_token = kTestAuthLoginAccessToken; |
| + fake_gaia_->SetMergeSessionParams(params); |
| + |
| + // Simulate an online sign-in. |
| + GetLoginDisplay()->ShowSigninScreenForCreds(kTestEmail, kTestAccountPassword); |
| + |
| + // User session should be terminated. |
| + termination_waiter.Wait(); |
| + |
| + // Merge session should fail. Check after |termination_waiter| to ensure |
| + // user profile is initialized and there is an OAuth2LoginManage. |
| + WaitForMergeSessionCompletion(OAuth2LoginManager::SESSION_RESTORE_FAILED); |
| +} |
| + |
| const char kGooglePageContent[] = |
| "<html><title>Hello!</title><script>alert('hello');</script>" |
| "<body>Hello Google!</body></html>"; |