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

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

Issue 1075273002: Handle ListAccount fetches from within the GaiaCookieManagerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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/fake_gaia_cookie_manager_service.cc
diff --git a/chrome/browser/signin/fake_gaia_cookie_manager_service.cc b/chrome/browser/signin/fake_gaia_cookie_manager_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4741d646c25f79c332825805319a8f924842a3c6
--- /dev/null
+++ b/chrome/browser/signin/fake_gaia_cookie_manager_service.cc
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/fake_gaia_cookie_manager_service.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/chrome_signin_client_factory.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "components/signin/core/browser/profile_oauth2_token_service.h"
+#include "google_apis/gaia/gaia_constants.h"
+#include "google_apis/gaia/gaia_urls.h"
+
+FakeGaiaCookieManagerService::FakeGaiaCookieManagerService(
+ OAuth2TokenService* token_service,
+ const std::string& source,
+ SigninClient* client) :
+ GaiaCookieManagerService(token_service, source, client),
+ url_fetcher_factory_(NULL) {
+ url_fetcher_factory_.SetFakeResponse(
+ GaiaUrls::GetInstance()->ListAccountsURLWithSource(
+ GaiaConstants::kChromeSource),
+ "[\"f\", []]",
+ net::HTTP_OK,
+ net::URLRequestStatus::SUCCESS);
Roger Tawa OOO till Jul 10th 2015/04/15 18:51:05 I think you can wrap lines 20-25 in a static helpe
Mike Lerman 2015/04/16 13:13:46 Discussed offline - adding helper methods to prepa
+}
+
+// static
+KeyedService* FakeGaiaCookieManagerService::Build(
+ content::BrowserContext* context) {
+ Profile* profile = Profile::FromBrowserContext(context);
+ GaiaCookieManagerService* service = new GaiaCookieManagerService(
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
+ GaiaConstants::kChromeSource,
+ ChromeSigninClientFactory::GetForProfile(profile));
+ return service;
+}

Powered by Google App Engine
This is Rietveld 408576698