OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |