Commit 50683f60 authored by msarda@chromium.org's avatar msarda@chromium.org

Fake PO2TS GetRequestContext should return NULL.

The fake PO2TS does not actually use the request context. This CL overrides the
GetRequestContext() in PO2TS and returns NULL to avoid errors like the ones
explained at (that occur on iOS)
https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/HWdp5roPpF4/j7drB1WW01EJ

BUG=NONE

Review URL: https://codereview.chromium.org/166573002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251341 0039d316-1c4b-4281-b951-d872f2087c98
parent 639b5a7f
......@@ -44,6 +44,12 @@ bool FakeProfileOAuth2TokenService::RefreshTokenIsAvailable(
return !GetRefreshToken(account_id).empty();
}
void FakeProfileOAuth2TokenService::LoadCredentials(
const std::string& primary_account_id) {
// Empty implementation as FakeProfileOAuth2TokenService does not have any
// credentials to load.
}
std::vector<std::string> FakeProfileOAuth2TokenService::GetAccounts() {
std::vector<std::string> account_ids;
for (std::map<std::string, std::string>::const_iterator iter =
......@@ -152,6 +158,11 @@ std::string FakeProfileOAuth2TokenService::GetRefreshToken(
std::string();
}
net::URLRequestContextGetter*
FakeProfileOAuth2TokenService::GetRequestContext() {
return NULL;
}
std::vector<FakeProfileOAuth2TokenService::PendingRequest>
FakeProfileOAuth2TokenService::GetPendingRequests() {
std::vector<PendingRequest> valid_requests;
......
......@@ -66,6 +66,9 @@ class FakeProfileOAuth2TokenService
virtual bool RefreshTokenIsAvailable(
const std::string& account_id) OVERRIDE;
// Overriden to make sure it works on iOS.
virtual void LoadCredentials(const std::string& primary_account_id) OVERRIDE;
virtual std::vector<std::string> GetAccounts() OVERRIDE;
// Overriden to make sure it works on Android. Simply calls
......@@ -135,6 +138,8 @@ class FakeProfileOAuth2TokenService
virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
private:
// Helper function to complete pending requests - if |all_scopes| is true,
// then all pending requests are completed, otherwise, only those requests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment