Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / signin / fake_gaia_cookie_manager_service.h
blob442b24ab09d85ccfd4d80e157ad0194ccb3b0ca9
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.
4 #ifndef CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
5 #define CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_
7 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/url_request/test_url_fetcher_factory.h"
12 namespace content {
13 class BrowserContext;
16 class FakeGaiaCookieManagerService : public GaiaCookieManagerService {
17 public:
18 FakeGaiaCookieManagerService(OAuth2TokenService* token_service,
19 const std::string& source,
20 SigninClient* client);
22 void Init(net::FakeURLFetcherFactory* url_fetcher_factory);
24 void SetListAccountsResponseHttpNotFound();
25 void SetListAccountsResponseWebLoginRequired();
26 void SetListAccountsResponseNoAccounts();
27 void SetListAccountsResponseOneAccount(
28 const char* email, const char* gaia_id);
29 void SetListAccountsResponseOneAccountWithExpiry(
30 const char* account, const char* gaia_id, bool expired);
31 void SetListAccountsResponseTwoAccounts(
32 const char* email1, const char* gaia_id1,
33 const char* email2, const char* gaia_id2);
34 void SetListAccountsResponseTwoAccountsWithExpiry(const char* email1,
35 const char* gaia_id1,
36 bool account1_expired,
37 const char* email2,
38 const char* gaia_id2,
39 bool account2_expired);
41 // Helper function to be used with KeyedService::SetTestingFactory().
42 static scoped_ptr<KeyedService> Build(content::BrowserContext* context);
44 private:
45 // Provide a fake response for calls to /ListAccounts.
46 net::FakeURLFetcherFactory* url_fetcher_factory_;
48 DISALLOW_COPY_AND_ASSIGN(FakeGaiaCookieManagerService);
51 #endif // CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_H_