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

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

Issue 338993007: Track when and how a profile is signed out via UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: SignOut() param in Android tests Created 6 years, 6 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
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 AccountReconcilorFactory::GetForProfile(profile()); 217 AccountReconcilorFactory::GetForProfile(profile());
218 ASSERT_TRUE(reconcilor); 218 ASSERT_TRUE(reconcilor);
219 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService()); 219 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService());
220 220
221 signin_manager()->set_password("password"); 221 signin_manager()->set_password("password");
222 signin_manager()->OnExternalSigninCompleted(kTestEmail); 222 signin_manager()->OnExternalSigninCompleted(kTestEmail);
223 ASSERT_TRUE(reconcilor->IsRegisteredWithTokenService()); 223 ASSERT_TRUE(reconcilor->IsRegisteredWithTokenService());
224 224
225 EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction()); 225 EXPECT_CALL(*GetMockReconcilor(), PerformLogoutAllAccountsAction());
226 226
227 signin_manager()->SignOut(); 227 signin_manager()->SignOut(signin_metrics::SIGNOUT_TEST);
228 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService()); 228 ASSERT_FALSE(reconcilor->IsRegisteredWithTokenService());
229 } 229 }
230 230
231 // This method requires the use of the |TestSigninClient| to be created from the 231 // This method requires the use of the |TestSigninClient| to be created from the
232 // |ChromeSigninClientFactory| because it overrides the |GoogleSigninSucceeded| 232 // |ChromeSigninClientFactory| because it overrides the |GoogleSigninSucceeded|
233 // method with an empty implementation. On MacOS, the normal implementation 233 // method with an empty implementation. On MacOS, the normal implementation
234 // causes the try_bots to time out. 234 // causes the try_bots to time out.
235 TEST_F(AccountReconcilorTest, Reauth) { 235 TEST_F(AccountReconcilorTest, Reauth) {
236 signin_manager()->SetAuthenticatedUsername(kTestEmail); 236 signin_manager()->SetAuthenticatedUsername(kTestEmail);
237 signin_manager()->set_password("password"); 237 signin_manager()->set_password("password");
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 757
758 base::RunLoop().RunUntilIdle(); 758 base::RunLoop().RunUntilIdle();
759 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com", 759 SimulateMergeSessionCompleted(reconcilor, "user@gmail.com",
760 GoogleServiceAuthError::AuthErrorNone()); 760 GoogleServiceAuthError::AuthErrorNone());
761 ASSERT_FALSE(reconcilor->is_reconcile_started_); 761 ASSERT_FALSE(reconcilor->is_reconcile_started_);
762 } 762 }
763 763
764 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, 764 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled,
765 AccountReconcilorTest, 765 AccountReconcilorTest,
766 testing::Bool()); 766 testing::Bool());
OLDNEW
« no previous file with comments | « chrome/browser/services/gcm/fake_signin_manager.cc ('k') | chrome/browser/signin/fake_signin_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698