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

Unified Diff: chrome/browser/google_apis/test_util.cc

Issue 15505003: GTTF: Convert most tests in content to use EmbeddedTestServer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang Created 7 years, 7 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
Index: chrome/browser/google_apis/test_util.cc
diff --git a/chrome/browser/google_apis/test_util.cc b/chrome/browser/google_apis/test_util.cc
index f7e5a828b5dac44e39520c7ea3797826759de3bf..ef91aecc948484ddf75ade8d32dd08a1cc839173 100644
--- a/chrome/browser/google_apis/test_util.cc
+++ b/chrome/browser/google_apis/test_util.cc
@@ -126,11 +126,11 @@ scoped_ptr<base::Value> LoadJSONFile(const std::string& relative_path) {
}
// Returns a HttpResponse created from the given file path.
-scoped_ptr<net::test_server::HttpResponse> CreateHttpResponseFromFile(
+scoped_ptr<net::test_server::BasicHttpResponse> CreateHttpResponseFromFile(
const base::FilePath& file_path) {
std::string content;
if (!file_util::ReadFileToString(file_path, &content))
- return scoped_ptr<net::test_server::HttpResponse>();
+ return scoped_ptr<net::test_server::BasicHttpResponse>();
std::string content_type = "text/plain";
if (EndsWith(file_path.AsUTF8Unsafe(), ".json", true /* case sensitive */)) {
@@ -139,8 +139,8 @@ scoped_ptr<net::test_server::HttpResponse> CreateHttpResponseFromFile(
content_type = "application/atom+xml";
}
- scoped_ptr<net::test_server::HttpResponse> http_response(
- new net::test_server::HttpResponse);
+ scoped_ptr<net::test_server::BasicHttpResponse> http_response(
+ new net::test_server::BasicHttpResponse);
http_response->set_code(net::test_server::SUCCESS);
http_response->set_content(content);
http_response->set_content_type(content_type);
@@ -157,7 +157,8 @@ scoped_ptr<net::test_server::HttpResponse> HandleDownloadRequest(
std::string remaining_path;
if (!RemovePrefix(absolute_url.path(), "/files/", &remaining_path))
return scoped_ptr<net::test_server::HttpResponse>();
- return CreateHttpResponseFromFile(GetTestFilePath(remaining_path));
+ return CreateHttpResponseFromFile(
+ GetTestFilePath(remaining_path)).PassAs<net::test_server::HttpResponse>();
}
bool VerifyJsonData(const base::FilePath& expected_json_file_path,
« no previous file with comments | « chrome/browser/google_apis/test_util.h ('k') | chrome/browser/ui/app_list/search/webstore_provider_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698