Index: net/test/url_request/url_request_mock_http_job.cc |
diff --git a/net/test/url_request/url_request_mock_http_job.cc b/net/test/url_request/url_request_mock_http_job.cc |
index b7b4cdbf619c016c90e4349f24e5db2d7881b731..297d0ffb5a3405d6a36782e94ec9eaaa2809681c 100644 |
--- a/net/test/url_request/url_request_mock_http_job.cc |
+++ b/net/test/url_request/url_request_mock_http_job.cc |
@@ -91,13 +91,8 @@ std::string DoFileIO(const base::FilePath& file_path) { |
// For a given file |path| and |scheme|, return the URL served by the |
// URlRequestMockHTTPJob. |
-GURL GetMockUrlForScheme(const base::FilePath& path, |
- const std::string& scheme) { |
- std::string url = scheme + "://" + kMockHostname + "/"; |
- std::string path_str = path.MaybeAsASCII(); |
- DCHECK(!path_str.empty()); // We only expect ASCII paths in tests. |
- url.append(path_str); |
- return GURL(url); |
+GURL GetMockUrlForScheme(const std::string& path, const std::string& scheme) { |
+ return GURL(scheme + "://" + kMockHostname + "/" + path); |
} |
} // namespace |
@@ -115,16 +110,30 @@ void URLRequestMockHTTPJob::AddUrlHandlers( |
} |
// static |
-GURL URLRequestMockHTTPJob::GetMockUrl(const base::FilePath& path) { |
+GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) { |
return GetMockUrlForScheme(path, "http"); |
} |
// static |
-GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const base::FilePath& path) { |
+GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) { |
return GetMockUrlForScheme(path, "https"); |
} |
// static |
+GURL URLRequestMockHTTPJob::GetMockUrl(const base::FilePath& path) { |
+ std::string path_str = path.MaybeAsASCII(); |
+ DCHECK(!path_str.empty()); // We only expect ASCII paths in tests. |
+ return GetMockUrlForScheme(path_str, "http"); |
+} |
+ |
+// static |
+GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const base::FilePath& path) { |
+ std::string path_str = path.MaybeAsASCII(); |
+ DCHECK(!path_str.empty()); // We only expect ASCII paths in tests. |
+ return GetMockUrlForScheme(path_str, "https"); |
+} |
+ |
+// static |
scoped_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor( |
const base::FilePath& base_path, |
const scoped_refptr<base::SequencedWorkerPool>& worker_pool) { |