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

Side by Side Diff: net/test/url_request/url_request_mock_http_job.cc

Issue 1391423002: net: Remove FilePath version of URLRequestMockHTTPJob::GetMockUrl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke review Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/test/url_request/url_request_mock_http_job.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/test/url_request/url_request_mock_http_job.h" 5 #include "net/test/url_request/url_request_mock_http_job.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) { 113 GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) {
114 return GetMockUrlForScheme(path, "http"); 114 return GetMockUrlForScheme(path, "http");
115 } 115 }
116 116
117 // static 117 // static
118 GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) { 118 GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) {
119 return GetMockUrlForScheme(path, "https"); 119 return GetMockUrlForScheme(path, "https");
120 } 120 }
121 121
122 // static 122 // static
123 GURL URLRequestMockHTTPJob::GetMockUrl(const base::FilePath& path) {
124 std::string path_str = path.MaybeAsASCII();
125 DCHECK(!path_str.empty()); // We only expect ASCII paths in tests.
126 return GetMockUrlForScheme(path_str, "http");
127 }
128
129 // static
130 scoped_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor( 123 scoped_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor(
131 const base::FilePath& base_path, 124 const base::FilePath& base_path,
132 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) { 125 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) {
133 return scoped_ptr<URLRequestInterceptor>( 126 return scoped_ptr<URLRequestInterceptor>(
134 new MockJobInterceptor(base_path, false, worker_pool)); 127 new MockJobInterceptor(base_path, false, worker_pool));
135 } 128 }
136 129
137 // static 130 // static
138 scoped_ptr<URLRequestInterceptor> 131 scoped_ptr<URLRequestInterceptor>
139 URLRequestMockHTTPJob::CreateInterceptorForSingleFile( 132 URLRequestMockHTTPJob::CreateInterceptorForSingleFile(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return URLRequestJob::GetResponseCode(); 202 return URLRequestJob::GetResponseCode();
210 } 203 }
211 204
212 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { 205 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) {
213 HttpResponseInfo info; 206 HttpResponseInfo info;
214 GetResponseInfo(&info); 207 GetResponseInfo(&info);
215 return info.headers.get() && info.headers->GetCharset(charset); 208 return info.headers.get() && info.headers->GetCharset(charset);
216 } 209 }
217 210
218 } // namespace net 211 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_mock_http_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698