OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base_test_server.h" | 5 #include "net/test/base_test_server.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 } | 198 } |
199 | 199 |
200 GURL BaseTestServer::GetURLWithUserAndPassword(const std::string& path, | 200 GURL BaseTestServer::GetURLWithUserAndPassword(const std::string& path, |
201 const std::string& user, | 201 const std::string& user, |
202 const std::string& password) const { | 202 const std::string& password) const { |
203 return GURL(GetScheme() + "://" + user + ":" + password + "@" + | 203 return GURL(GetScheme() + "://" + user + ":" + password + "@" + |
204 host_port_pair_.ToString() + "/" + path); | 204 host_port_pair_.ToString() + "/" + path); |
205 } | 205 } |
206 | 206 |
207 // static | 207 // static |
208 base::FilePath BaseTestServer::GetSourcePath() { | |
209 base::FilePath src_dir; | |
210 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); | |
Paweł Hajdan Jr.
2013/02/11 15:36:53
Is it really needed to create a wrapper like that
| |
211 return src_dir; | |
212 } | |
213 | |
214 // static | |
215 base::FilePath BaseTestServer::GetTestDataPath() { | |
216 return GetSourcePath().Append(FILE_PATH_LITERAL("chrome/test/data")); | |
Paweł Hajdan Jr.
2013/02/11 15:36:53
net shouldn't know about chrome
| |
217 } | |
218 | |
219 // static | |
220 base::FilePath BaseTestServer::GetSourceRelativePath( | |
221 const base::FilePath& relative) { | |
222 return GetSourcePath().Append(relative); | |
223 } | |
224 | |
225 // static | |
208 bool BaseTestServer::GetFilePathWithReplacements( | 226 bool BaseTestServer::GetFilePathWithReplacements( |
209 const std::string& original_file_path, | 227 const std::string& original_file_path, |
210 const std::vector<StringPair>& text_to_replace, | 228 const std::vector<StringPair>& text_to_replace, |
211 std::string* replacement_path) { | 229 std::string* replacement_path) { |
212 std::string new_file_path = original_file_path; | 230 std::string new_file_path = original_file_path; |
213 bool first_query_parameter = true; | 231 bool first_query_parameter = true; |
214 const std::vector<StringPair>::const_iterator end = text_to_replace.end(); | 232 const std::vector<StringPair>::const_iterator end = text_to_replace.end(); |
215 for (std::vector<StringPair>::const_iterator it = text_to_replace.begin(); | 233 for (std::vector<StringPair>::const_iterator it = text_to_replace.begin(); |
216 it != end; | 234 it != end; |
217 ++it) { | 235 ++it) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 | 408 |
391 return GenerateAdditionalArguments(arguments); | 409 return GenerateAdditionalArguments(arguments); |
392 } | 410 } |
393 | 411 |
394 bool BaseTestServer::GenerateAdditionalArguments( | 412 bool BaseTestServer::GenerateAdditionalArguments( |
395 base::DictionaryValue* arguments) const { | 413 base::DictionaryValue* arguments) const { |
396 return true; | 414 return true; |
397 } | 415 } |
398 | 416 |
399 } // namespace net | 417 } // namespace net |
OLD | NEW |