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

Unified Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 1496573002: Ensure Sync access token is revoked when user is signed out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/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();

Powered by Google App Engine
This is Rietveld 408576698