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

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

Issue 1498663002: [Sync] Clear access token on shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No really 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
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9788f238df3fd3936afaef5c9f8bf2a9833cdfb1..5b69f26bea64e64f016aecb1079e74963297b413 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -685,6 +685,30 @@ TEST_F(ProfileSyncServiceTest, RevokeAccessTokenFromTokenService) {
EXPECT_TRUE(service()->GetAccessTokenForTest().empty());
}
+// CrOS does not support signout.
+#if !defined(OS_CHROMEOS)
+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());
+}
+#endif
+
#if BUILDFLAG(ENABLE_PRE_SYNC_BACKUP)
TEST_F(ProfileSyncServiceTest, DontStartBackupOnBrowserStart) {
CreateServiceWithoutSignIn();
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698