Commit f10ba887 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Remove FakeAccountFetcherService::FakeUserInfoFetchSuccess

IdentityTestEnvironment is the only caller and it can just call
AccountTrackerService directly.

Bug: 935998
Change-Id: Ic5c1546359e38ba97bda9f33f92ba53918660ce9
Reviewed-on: https://chromium-review.googlesource.com/c/1489198Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635557}
parent 60f1e204
...@@ -33,6 +33,10 @@ namespace base { ...@@ -33,6 +33,10 @@ namespace base {
class DictionaryValue; class DictionaryValue;
} }
namespace identity {
class IdentityTestEnvironment;
}
// AccountTrackerService is a KeyedService that retrieves and caches GAIA // AccountTrackerService is a KeyedService that retrieves and caches GAIA
// information about Google Accounts. // information about Google Accounts.
class AccountTrackerService : public KeyedService { class AccountTrackerService : public KeyedService {
...@@ -133,7 +137,7 @@ class AccountTrackerService : public KeyedService { ...@@ -133,7 +137,7 @@ class AccountTrackerService : public KeyedService {
private: private:
friend class AccountFetcherService; friend class AccountFetcherService;
friend class FakeAccountFetcherService; friend class identity::IdentityTestEnvironment;
void NotifyAccountUpdated(const AccountInfo& account_info); void NotifyAccountUpdated(const AccountInfo& account_info);
void NotifyAccountUpdateFailed(const std::string& account_id); void NotifyAccountUpdateFailed(const std::string& account_id);
......
...@@ -11,26 +11,6 @@ ...@@ -11,26 +11,6 @@
FakeAccountFetcherService::FakeAccountFetcherService() {} FakeAccountFetcherService::FakeAccountFetcherService() {}
void FakeAccountFetcherService::FakeUserInfoFetchSuccess(
const std::string& account_id,
const std::string& email,
const std::string& gaia,
const std::string& hosted_domain,
const std::string& full_name,
const std::string& given_name,
const std::string& locale,
const std::string& picture_url) {
base::DictionaryValue user_info;
user_info.SetString("id", gaia);
user_info.SetString("email", email);
user_info.SetString("hd", hosted_domain);
user_info.SetString("name", full_name);
user_info.SetString("given_name", given_name);
user_info.SetString("locale", locale);
user_info.SetString("picture", picture_url);
account_tracker_service()->SetAccountInfoFromUserInfo(account_id, &user_info);
}
void FakeAccountFetcherService::StartFetchingUserInfo( void FakeAccountFetcherService::StartFetchingUserInfo(
const std::string& account_id) { const std::string& account_id) {
// In tests, don't do actual network fetch. // In tests, don't do actual network fetch.
......
...@@ -18,15 +18,6 @@ class KeyedService; ...@@ -18,15 +18,6 @@ class KeyedService;
// to prevent AccountTrackerService from sending network requests. // to prevent AccountTrackerService from sending network requests.
class FakeAccountFetcherService : public AccountFetcherService { class FakeAccountFetcherService : public AccountFetcherService {
public: public:
void FakeUserInfoFetchSuccess(const std::string& account_id,
const std::string& email,
const std::string& gaia,
const std::string& hosted_domain,
const std::string& full_name,
const std::string& given_name,
const std::string& locale,
const std::string& picture_url);
FakeAccountFetcherService(); FakeAccountFetcherService();
private: private:
......
...@@ -591,9 +591,15 @@ void IdentityTestEnvironment::SimulateSuccessfulFetchOfAccountInfo( ...@@ -591,9 +591,15 @@ void IdentityTestEnvironment::SimulateSuccessfulFetchOfAccountInfo(
const std::string& given_name, const std::string& given_name,
const std::string& locale, const std::string& locale,
const std::string& picture_url) { const std::string& picture_url) {
account_fetcher_service_->FakeUserInfoFetchSuccess( base::DictionaryValue user_info;
account_id, email, gaia, hosted_domain, full_name, given_name, locale, user_info.SetString("id", gaia);
picture_url); user_info.SetString("email", email);
user_info.SetString("hd", hosted_domain);
user_info.SetString("name", full_name);
user_info.SetString("given_name", given_name);
user_info.SetString("locale", locale);
user_info.SetString("picture", picture_url);
account_tracker_service_->SetAccountInfoFromUserInfo(account_id, &user_info);
} }
void IdentityTestEnvironment::SimulateMergeSessionFailure( void IdentityTestEnvironment::SimulateMergeSessionFailure(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment