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

Side by Side Diff: chrome/browser/signin/fake_gaia_cookie_manager_service.cc

Issue 1104153002: Expose ReconcilorState. Rename MergeSession in Signin Tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: VLOGging the reconcilor Created 5 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/signin/fake_gaia_cookie_manager_service.h" 5 #include "chrome/browser/signin/fake_gaia_cookie_manager_service.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/chrome_signin_client_factory.h" 9 #include "chrome/browser/signin/chrome_signin_client_factory.h"
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
(...skipping 16 matching lines...) Expand all
27 void FakeGaiaCookieManagerService::SetListAccountsResponseHttpNotFound() { 27 void FakeGaiaCookieManagerService::SetListAccountsResponseHttpNotFound() {
28 DCHECK(url_fetcher_factory_); 28 DCHECK(url_fetcher_factory_);
29 url_fetcher_factory_->SetFakeResponse( 29 url_fetcher_factory_->SetFakeResponse(
30 GaiaUrls::GetInstance()->ListAccountsURLWithSource( 30 GaiaUrls::GetInstance()->ListAccountsURLWithSource(
31 GaiaConstants::kChromeSource), 31 GaiaConstants::kChromeSource),
32 "", 32 "",
33 net::HTTP_NOT_FOUND, 33 net::HTTP_NOT_FOUND,
34 net::URLRequestStatus::SUCCESS); 34 net::URLRequestStatus::SUCCESS);
35 } 35 }
36 36
37 void FakeGaiaCookieManagerService::SetListAccountsResponseWebLoginRequired() {
38 DCHECK(url_fetcher_factory_);
39 url_fetcher_factory_->SetFakeResponse(
40 GaiaUrls::GetInstance()->ListAccountsURLWithSource(
41 GaiaConstants::kChromeSource),
42 "Info=WebLoginRequired",
43 net::HTTP_OK,
44 net::URLRequestStatus::SUCCESS);
45 }
46
37 void FakeGaiaCookieManagerService::SetListAccountsResponseNoAccounts() { 47 void FakeGaiaCookieManagerService::SetListAccountsResponseNoAccounts() {
38 DCHECK(url_fetcher_factory_); 48 DCHECK(url_fetcher_factory_);
39 url_fetcher_factory_->SetFakeResponse( 49 url_fetcher_factory_->SetFakeResponse(
40 GaiaUrls::GetInstance()->ListAccountsURLWithSource( 50 GaiaUrls::GetInstance()->ListAccountsURLWithSource(
41 GaiaConstants::kChromeSource), 51 GaiaConstants::kChromeSource),
42 "[\"f\", []]", 52 "[\"f\", []]",
43 net::HTTP_OK, 53 net::HTTP_OK,
44 net::URLRequestStatus::SUCCESS); 54 net::URLRequestStatus::SUCCESS);
45 } 55 }
46 56
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // static 113 // static
104 KeyedService* FakeGaiaCookieManagerService::Build( 114 KeyedService* FakeGaiaCookieManagerService::Build(
105 content::BrowserContext* context) { 115 content::BrowserContext* context) {
106 Profile* profile = Profile::FromBrowserContext(context); 116 Profile* profile = Profile::FromBrowserContext(context);
107 FakeGaiaCookieManagerService* service = new FakeGaiaCookieManagerService( 117 FakeGaiaCookieManagerService* service = new FakeGaiaCookieManagerService(
108 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 118 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
109 GaiaConstants::kChromeSource, 119 GaiaConstants::kChromeSource,
110 ChromeSigninClientFactory::GetForProfile(profile)); 120 ChromeSigninClientFactory::GetForProfile(profile));
111 return service; 121 return service;
112 } 122 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/fake_gaia_cookie_manager_service.h ('k') | chrome/browser/signin/signin_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698