Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / signin / core / browser / fake_account_fetcher_service.cc
blob39fa0212df2b7cd3e7a0d20509e192f02db39558
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/signin/core/browser/fake_account_fetcher_service.h"
7 #include "base/values.h"
8 #include "components/signin/core/browser/account_tracker_service.h"
9 #include "components/signin/core/browser/profile_oauth2_token_service.h"
11 FakeAccountFetcherService::FakeAccountFetcherService() {}
13 void FakeAccountFetcherService::FakeUserInfoFetchSuccess(
14 const std::string& account_id,
15 const std::string& email,
16 const std::string& gaia,
17 const std::string& hosted_domain,
18 const std::string& full_name,
19 const std::string& given_name,
20 const std::string& locale,
21 const std::string& picture_url) {
22 base::DictionaryValue user_info;
23 user_info.SetString("id", gaia);
24 user_info.SetString("email", email);
25 user_info.SetString("hd", hosted_domain);
26 user_info.SetString("name", full_name);
27 user_info.SetString("given_name", given_name);
28 user_info.SetString("locale", locale);
29 user_info.SetString("picture", picture_url);
30 account_tracker_service()->SetAccountStateFromUserInfo(account_id,
31 &user_info);
34 void FakeAccountFetcherService::FakeSetIsChildAccount(
35 const std::string& account_id,
36 const bool& is_child_account) {
37 SetIsChildAccount(account_id, is_child_account);
40 void FakeAccountFetcherService::StartFetchingUserInfo(
41 const std::string& account_id) {
42 // In tests, don't do actual network fetch.
45 void FakeAccountFetcherService::StartFetchingChildInfo(
46 const std::string& account_id) {
47 // In tests, don't do actual network fetch.
50 void FakeAccountFetcherService::SendRefreshTokenAnnotationRequest(
51 const std::string& account_id) {
52 // In tests, don't do actual network fetch.