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

Side by Side Diff: chrome/browser/signin/account_reconcilor_unittest.cc

Issue 267703003: Logout all accounts from cookie jar when disconnecting from chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | components/signin/core/browser/account_reconcilor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "chrome/browser/signin/account_reconcilor_factory.h" 8 #include "chrome/browser/signin/account_reconcilor_factory.h"
9 #include "chrome/browser/signin/chrome_signin_client_factory.h" 9 #include "chrome/browser/signin/chrome_signin_client_factory.h"
10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 10 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 TEST_F(AccountReconcilorTest, SigninManagerRegistration) { 172 TEST_F(AccountReconcilorTest, SigninManagerRegistration) {
173 AccountReconcilor* reconcilor = 173 AccountReconcilor* reconcilor =
174 AccountReconcilorFactory::GetForProfile(profile()); 174 AccountReconcilorFactory::GetForProfile(profile());
175 ASSERT_TRUE(reconcilor); 175 ASSERT_TRUE(reconcilor);
176 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService()); 176 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService());
177 177
178 signin_manager()->OnExternalSigninCompleted(kTestEmail); 178 signin_manager()->OnExternalSigninCompleted(kTestEmail);
179 ASSERT_TRUE(reconcilor->IsRegisteredWithTokenService()); 179 ASSERT_TRUE(reconcilor->IsRegisteredWithTokenService());
180 180
181 EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction());
182
181 signin_manager()->SignOut(); 183 signin_manager()->SignOut();
182 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService()); 184 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService());
183 } 185 }
184 186
185 TEST_F(AccountReconcilorTest, Reauth) { 187 TEST_F(AccountReconcilorTest, Reauth) {
186 signin_manager()->SetAuthenticatedUsername(kTestEmail); 188 signin_manager()->SetAuthenticatedUsername(kTestEmail);
187 189
188 AccountReconcilor* reconcilor = 190 AccountReconcilor* reconcilor =
189 AccountReconcilorFactory::GetForProfile(profile()); 191 AccountReconcilorFactory::GetForProfile(profile());
190 ASSERT_TRUE(reconcilor); 192 ASSERT_TRUE(reconcilor);
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 token_service()->IssueAllTokensForAccount("user@gmail.com", "access_token", 557 token_service()->IssueAllTokensForAccount("user@gmail.com", "access_token",
556 base::Time::Now() + base::TimeDelta::FromHours(1)); 558 base::Time::Now() + base::TimeDelta::FromHours(1));
557 token_service()->IssueAllTokensForAccount("other@gmail.com", "access_token", 559 token_service()->IssueAllTokensForAccount("other@gmail.com", "access_token",
558 base::Time::Now() + base::TimeDelta::FromHours(1)); 560 base::Time::Now() + base::TimeDelta::FromHours(1));
559 561
560 base::RunLoop().RunUntilIdle(); 562 base::RunLoop().RunUntilIdle();
561 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com", 563 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com",
562 GoogleServiceAuthError::AuthErrorNone()); 564 GoogleServiceAuthError::AuthErrorNone());
563 ASSERT_FALSE(reconcilor->is_reconcile_started_); 565 ASSERT_FALSE(reconcilor->is_reconcile_started_);
564 } 566 }
OLDNEW
« no previous file with comments | « no previous file | components/signin/core/browser/account_reconcilor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698