Index: chrome/browser/sync/profile_sync_service_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc |
index a3efd9658481be09e11fd0181e5c48a3a481edbe..36059fa64a5ef537e6048c66bc40023dc949040f 100644 |
--- a/chrome/browser/sync/profile_sync_service_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc |
@@ -684,6 +684,27 @@ TEST_F(ProfileSyncServiceTest, RevokeAccessTokenFromTokenService) { |
EXPECT_TRUE(service()->GetAccessTokenForTest().empty()); |
} |
+TEST_F(ProfileSyncServiceTest, SignOutRevokeAccessToken) { |
+ CreateService(browser_sync::AUTO_START); |
+ IssueTestTokens(); |
+ ExpectDataTypeManagerCreation(1, GetDefaultConfigureCalledCallback()); |
+ ExpectSyncBackendHostCreation(1); |
+ InitializeForNthSync(); |
+ EXPECT_TRUE(service()->IsSyncActive()); |
+ |
+ std::string primary_account_id = |
+ SigninManagerFactory::GetForProfile(profile()) |
+ ->GetAuthenticatedAccountId(); |
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile()) |
+ ->LoadCredentials(primary_account_id); |
+ base::RunLoop().RunUntilIdle(); |
+ EXPECT_FALSE(service()->GetAccessTokenForTest().empty()); |
+ |
+ SigninManagerFactory::GetForProfile(profile()) |
+ ->SignOut(signin_metrics::SIGNOUT_TEST); |
+ EXPECT_TRUE(service()->GetAccessTokenForTest().empty()); |
+} |
+ |
#if defined(ENABLE_PRE_SYNC_BACKUP) |
TEST_F(ProfileSyncServiceTest, DontStartBackupOnBrowserStart) { |
CreateServiceWithoutSignIn(); |