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

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

Issue 1075273002: Handle ListAccount fetches from within the GaiaCookieManagerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a test post 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.h
diff --git a/chrome/browser/signin/fake_gaia_cookie_manager_service.h b/chrome/browser/signin/fake_gaia_cookie_manager_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..b03750c948fdb4acf43669e3f41e9be67e9e51e8
--- /dev/null
+++ b/chrome/browser/signin/fake_gaia_cookie_manager_service.h
@@ -0,0 +1,44 @@
+// 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.
+#ifndef CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
+#define CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
+
+#include "components/signin/core/browser/gaia_cookie_manager_service.h"
+
+#include "net/url_request/test_url_fetcher_factory.h"
+
+namespace content {
+class BrowserContext;
+}
+
+class FakeGaiaCookieManagerService : public GaiaCookieManagerService {
+ public:
+ FakeGaiaCookieManagerService(OAuth2TokenService* token_service,
+ const std::string& source,
+ SigninClient* client);
+
+ void Init(net::FakeURLFetcherFactory* url_fetcher_factory);
+
+ void SetListAccountsResponseHttpNotFound();
+ void SetListAccountsResponseNoAccounts();
+ void SetListAccountsResponseOneAccount(const char* account);
+ void SetListAccountsResponseOneAccountWithExpiry(
+ const char* account, bool expired);
+ void SetListAccountsResponseTwoAccounts(const char* account1,
+ const char* account2);
+ void SetListAccountsResponseTwoAccountsWithExpiry(
+ const char* account1, bool account1_expired,
+ const char* account2, bool account2_expired);
+
+ // Helper function to be used with KeyedService::SetTestingFactory().
+ static KeyedService* Build(content::BrowserContext* context);
+
+ private:
+ // Provide a fake response for calls to /ListAccounts.
+ net::FakeURLFetcherFactory* url_fetcher_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeGaiaCookieManagerService);
+};
+
+#endif // CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
« no previous file with comments | « chrome/browser/signin/fake_account_reconcilor.cc ('k') | chrome/browser/signin/fake_gaia_cookie_manager_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698