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

Side by Side Diff: chrome/browser/extensions/api/identity/account_tracker_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 "chrome/browser/extensions/api/identity/account_tracker.h" 5 #include "chrome/browser/extensions/api/identity/account_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 AccountTracker* account_tracker() { 324 AccountTracker* account_tracker() {
325 return account_tracker_.get(); 325 return account_tracker_.get();
326 } 326 }
327 327
328 // Helpers to pass fake events to the tracker. 328 // Helpers to pass fake events to the tracker.
329 329
330 void NotifyRemoveAccount(const std::string& username) { 330 void NotifyRemoveAccount(const std::string& username) {
331 #if !defined(OS_CHROMEOS) 331 #if !defined(OS_CHROMEOS)
332 if (username == kPrimaryAccountKey) 332 if (username == kPrimaryAccountKey)
333 fake_signin_manager_->SignOut(); 333 fake_signin_manager_->SignOut(signin_metrics::SIGNOUT_TEST);
334 else 334 else
335 account_tracker()->GoogleSignedOut(username); 335 account_tracker()->GoogleSignedOut(username);
336 #else 336 #else
337 account_tracker()->GoogleSignedOut(username); 337 account_tracker()->GoogleSignedOut(username);
338 #endif 338 #endif
339 } 339 }
340 340
341 void NotifyTokenAvailable(const std::string& username) { 341 void NotifyTokenAvailable(const std::string& username) {
342 fake_oauth2_token_service_->IssueRefreshTokenForUser(username, 342 fake_oauth2_token_service_->IssueRefreshTokenForUser(username,
343 "refresh_token"); 343 "refresh_token");
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 NotifyTokenAvailable("alpha@example.com"); 720 NotifyTokenAvailable("alpha@example.com");
721 ReturnOAuthUrlFetchSuccess("alpha@example.com"); 721 ReturnOAuthUrlFetchSuccess("alpha@example.com");
722 722
723 NotifyTokenRevoked(kPrimaryAccountKey); 723 NotifyTokenRevoked(kPrimaryAccountKey);
724 724
725 std::vector<AccountIds> ids = account_tracker()->GetAccounts(); 725 std::vector<AccountIds> ids = account_tracker()->GetAccounts();
726 EXPECT_EQ(0ul, ids.size()); 726 EXPECT_EQ(0ul, ids.size());
727 } 727 }
728 728
729 } // namespace extensions 729 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698