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

Unified Diff: net/test/base_test_server.cc

Issue 12210088: Make the TestServer use an absolute document root path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testserver uses absolute docroot path Created 7 years, 10 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: net/test/base_test_server.cc
diff --git a/net/test/base_test_server.cc b/net/test/base_test_server.cc
index 5babc9f6549fa1007ae29d9e5ceb04b4580f0071..d13fdbf58a1969369f9d1b4276fddac3ef7c9e49 100644
--- a/net/test/base_test_server.cc
+++ b/net/test/base_test_server.cc
@@ -205,6 +205,24 @@ GURL BaseTestServer::GetURLWithUserAndPassword(const std::string& path,
}
// static
+base::FilePath BaseTestServer::GetSourcePath() {
+ base::FilePath src_dir;
+ 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
+ return src_dir;
+}
+
+// static
+base::FilePath BaseTestServer::GetTestDataPath() {
+ return GetSourcePath().Append(FILE_PATH_LITERAL("chrome/test/data"));
Paweł Hajdan Jr. 2013/02/11 15:36:53 net shouldn't know about chrome
+}
+
+// static
+base::FilePath BaseTestServer::GetSourceRelativePath(
+ const base::FilePath& relative) {
+ return GetSourcePath().Append(relative);
+}
+
+// static
bool BaseTestServer::GetFilePathWithReplacements(
const std::string& original_file_path,
const std::vector<StringPair>& text_to_replace,

Powered by Google App Engine
This is Rietveld 408576698