summaryrefslogtreecommitdiff
path: root/chromium/components/signin/core/browser/test_signin_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/signin/core/browser/test_signin_client.h')
-rw-r--r--chromium/components/signin/core/browser/test_signin_client.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/chromium/components/signin/core/browser/test_signin_client.h b/chromium/components/signin/core/browser/test_signin_client.h
index 3aeb831f664..8e487d613cd 100644
--- a/chromium/components/signin/core/browser/test_signin_client.h
+++ b/chromium/components/signin/core/browser/test_signin_client.h
@@ -17,6 +17,9 @@
#include "components/signin/core/browser/signin_client.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "net/url_request/url_request_test_util.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
class PrefService;
@@ -43,7 +46,7 @@ class TestSigninClient : public SigninClient {
// Returns true.
bool CanRevokeCredentials() override;
- // Returns empty string.
+ // Returns a dummy device ID.
std::string GetSigninScopedDeviceId() override;
// Does nothing.
@@ -59,16 +62,21 @@ class TestSigninClient : public SigninClient {
// Returns the empty string.
std::string GetProductVersion() override;
- // Returns a TestURLRequestContextGetter or an manually provided
- // URLRequestContextGetter.
+ // Returns a manually provided URLRequestContextGetter.
net::URLRequestContextGetter* GetURLRequestContext() override;
- // For testing purposes, can override the TestURLRequestContextGetter created
- // in the default constructor.
+ // Tells GetURLRequestContext() what to return.
void SetURLRequestContext(net::URLRequestContextGetter* request_context);
- // Returns true.
- bool ShouldMergeSigninCredentialsIntoCookieJar() override;
+ // Wraps the test_url_loader_factory(). Note that this is totally independent
+ // of GetURLRequestContext(), so you may need to set some things differently
+ // based on what API the consumer is using, while transition away from
+ // URLRequestContextGetter is going on.
+ scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
+
+ network::TestURLLoaderFactory* test_url_loader_factory() {
+ return &test_url_loader_factory_;
+ }
// Registers |callback| and returns the subscription.
// Note that |callback| will never be called.
@@ -99,7 +107,8 @@ class TestSigninClient : public SigninClient {
std::unique_ptr<GaiaAuthFetcher> CreateGaiaAuthFetcher(
GaiaAuthConsumer* consumer,
const std::string& source,
- net::URLRequestContextGetter* getter) override;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ override;
void PreGaiaLogout(base::OnceClosure callback) override;
// Loads the token database.
@@ -108,6 +117,9 @@ class TestSigninClient : public SigninClient {
private:
base::ScopedTempDir temp_dir_;
scoped_refptr<net::URLRequestContextGetter> request_context_;
+ network::TestURLLoaderFactory test_url_loader_factory_;
+ scoped_refptr<network::SharedURLLoaderFactory> shared_factory_;
+
scoped_refptr<TokenWebData> database_;
PrefService* pref_service_;
bool are_signin_cookies_allowed_;