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

Unified Diff: chrome/browser/signin/account_reconcilor_unittest.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/account_reconcilor_unittest.cc
diff --git a/chrome/browser/signin/account_reconcilor_unittest.cc b/chrome/browser/signin/account_reconcilor_unittest.cc
index fe138495977587bdc20e8e5090500867f90cc568..617008ca97775686c0849ad1d865bb7e1a178af8 100644
--- a/chrome/browser/signin/account_reconcilor_unittest.cc
+++ b/chrome/browser/signin/account_reconcilor_unittest.cc
@@ -32,6 +32,7 @@
#include "components/signin/core/browser/test_signin_client.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "components/signin/core/common/signin_switches.h"
+#include "components/user_manager/user_id.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_urls.h"
@@ -103,15 +104,13 @@ class AccountReconcilorTest : public ::testing::TestWithParam<bool> {
MockAccountReconcilor* GetMockReconcilor();
- std::string ConnectProfileToAccount(const std::string& gaia_id,
- const std::string& username);
+ std::string ConnectProfileToAccount(const user_manager::UserID& user_id);
- std::string PickAccountIdForAccount(const std::string& gaia_id,
- const std::string& username);
+ std::string PickAccountIdForAccount(const user_manager::UserID& user_id);
void SimulateAddAccountToCookieCompleted(
GaiaCookieManagerService::Observer* observer,
- const std::string& account_id,
+ const user_manager::UserID& user_id,
const GoogleServiceAuthError& error);
void SimulateCookieContentSettingsChanged(
@@ -220,21 +219,17 @@ MockAccountReconcilor* AccountReconcilorTest::GetMockReconcilor() {
}
std::string AccountReconcilorTest::ConnectProfileToAccount(
- const std::string& gaia_id,
- const std::string& username) {
- const std::string account_id = PickAccountIdForAccount(gaia_id, username);
+ const user_manager::UserID& user_id) {
#if !defined(OS_CHROMEOS)
signin_manager()->set_password("password");
#endif
- signin_manager()->SetAuthenticatedAccountInfo(gaia_id, username);
- token_service()->UpdateCredentials(account_id, "refresh_token");
+ signin_manager()->SetAuthenticatedAccountInfo(user_id);
+ token_service()->UpdateCredentials(user_id, "refresh_token");
return account_id;
}
-std::string AccountReconcilorTest::PickAccountIdForAccount(
- const std::string& gaia_id,
- const std::string& username) {
- return account_tracker()->PickAccountIdForAccount(gaia_id, username);
+std::string AccountReconcilorTest::PickAccountIdForAccount(const user_manager::UserID& user_id) {
+ return account_tracker()->PickAccountIdForAccount(user_id);
}
void AccountReconcilorTest::SimulateAddAccountToCookieCompleted(

Powered by Google App Engine
This is Rietveld 408576698