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

Unified Diff: net/test/remote_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: 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
« net/test/local_test_server.h ('K') | « net/test/remote_test_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/remote_test_server.cc
diff --git a/net/test/remote_test_server.cc b/net/test/remote_test_server.cc
index 3421fa55ebecd27cac35f6b07a85022624f92e1a..f806195f895af34499e81401140b423719afc7c0 100644
--- a/net/test/remote_test_server.cc
+++ b/net/test/remote_test_server.cc
@@ -161,9 +161,6 @@ FilePath RemoteTestServer::GetDocumentRoot() const {
}
bool RemoteTestServer::Init(const FilePath& document_root) {
- if (document_root.IsAbsolute())
- return false;
-
// Gets ports information used by test server spawner and Python test server.
int test_server_port = 0;
@@ -193,10 +190,20 @@ bool RemoteTestServer::Init(const FilePath& document_root) {
return false;
SetPort(test_server_port);
- SetResourcePath(document_root, FilePath().AppendASCII("net")
- .AppendASCII("data")
- .AppendASCII("ssl")
- .AppendASCII("certificates"));
+ FilePath root;
+ if (document_root.IsAbsolute()) {
+ root = document_root;
+ } else {
+ FilePath src_dir;
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir))
+ return false;
+ root = src_dir.Append(document_root);
+ }
+
+ SetResourcePath(root, FilePath().AppendASCII("net")
+ .AppendASCII("data")
+ .AppendASCII("ssl")
+ .AppendASCII("certificates"));
return true;
}
« net/test/local_test_server.h ('K') | « net/test/remote_test_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698