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

Unified Diff: google_apis/gaia/fake_gaia.cc

Issue 2668043002: Reland cros: Test for overlapping ContinueSessionRestore calls (Closed)
Patch Set: for comments in #4 Created 3 years, 11 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
« no previous file with comments | « google_apis/gaia/fake_gaia.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.cc
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index ce62f1f1703db8c5dd91fcf770e6483c8d8a787e..7ec5af739ecee3bf829d0d35593a5bcde87783b4 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -298,6 +298,11 @@ void FakeGaia::Initialize() {
// Handles /oauth2/v1/userinfo call.
REGISTER_RESPONSE_HANDLER(
gaia_urls->oauth_user_info_url(), HandleOAuthUserInfo);
+
+ // Handles /GetCheckConnectionInfo GAIA call.
+ REGISTER_RESPONSE_HANDLER(
+ gaia_urls->GetCheckConnectionInfoURLWithSource(std::string()),
+ HandleGetCheckConnectionInfo);
}
std::unique_ptr<HttpResponse> FakeGaia::HandleRequest(
@@ -443,10 +448,10 @@ void FakeGaia::HandleProgramaticAuth(
http_response->set_content_type("text/html");
}
-void FakeGaia::FormatJSONResponse(const base::DictionaryValue& response_dict,
+void FakeGaia::FormatJSONResponse(const base::Value& value,
BasicHttpResponse* http_response) {
std::string response_json;
- base::JSONWriter::Write(response_dict, &response_json);
+ base::JSONWriter::Write(value, &response_json);
http_response->set_content(response_json);
http_response->set_code(net::HTTP_OK);
}
@@ -840,3 +845,10 @@ void FakeGaia::HandleSAMLRedirect(
http_response->AddCustomHeader("Google-Accounts-SAML", "Start");
http_response->AddCustomHeader("Location", redirect_url);
}
+
+void FakeGaia::HandleGetCheckConnectionInfo(
+ const net::test_server::HttpRequest& request,
+ net::test_server::BasicHttpResponse* http_response) {
+ base::ListValue connection_list;
+ FormatJSONResponse(connection_list, http_response);
+}
« no previous file with comments | « google_apis/gaia/fake_gaia.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698