Chromium Code Reviews| Index: google_apis/gaia/fake_gaia.cc |
| diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc |
| index 4cfe6040e53e0ab68bc4dac93116348e3fa8caf1..edf3647d70fb0f2e19649054c9162fc2f623d645 100644 |
| --- a/google_apis/gaia/fake_gaia.cc |
| +++ b/google_apis/gaia/fake_gaia.cc |
| @@ -50,6 +50,7 @@ const char kAuthHeaderOAuth[] = "OAuth "; |
| const char kListAccountsResponseFormat[] = |
| "[\"gaia.l.a.r\",[[\"gaia.l.a\",1,\"\",\"%s\",\"\",1,1,0]]]"; |
| +const char kPeopleGetResponseFormat[] = "{\"id\":\"%s\"}"; |
| typedef std::map<std::string, std::string> CookieMap; |
| @@ -176,6 +177,10 @@ void FakeGaia::Initialize() { |
| // Handles /ListAccounts GAIA call. |
| REGISTER_RESPONSE_HANDLER( |
| gaia_urls->list_accounts_url(), HandleListAccounts); |
| + |
| + // Handles /plus/v1/people/me |
| + REGISTER_RESPONSE_HANDLER( |
| + gaia_urls->people_get_url(), HandlePeopleGet); |
| } |
| scoped_ptr<HttpResponse> FakeGaia::HandleRequest(const HttpRequest& request) { |
| @@ -529,3 +534,11 @@ void FakeGaia::HandleListAccounts(const HttpRequest& request, |
| kListAccountsResponseFormat, merge_session_params_.email.c_str())); |
| http_response->set_code(net::HTTP_OK); |
| } |
| + |
| + |
| +void FakeGaia::HandlePeopleGet(const HttpRequest& request, |
| + BasicHttpResponse* http_response) { |
| + http_response->set_content(base::StringPrintf( |
| + kPeopleGetResponseFormat, "name")); |
|
Roger Tawa OOO till Jul 10th
2014/05/27 19:15:38
Is it worth using StringPrintf if we are hardcodin
Mike Lerman
2014/05/27 19:43:03
Done.
|
| + http_response->set_code(net::HTTP_OK); |
| +} |