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

Unified Diff: net/test/local_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
Index: net/test/local_test_server.cc
diff --git a/net/test/local_test_server.cc b/net/test/local_test_server.cc
index a24d6bb0d25a6ab975fe167c5c4c660b64b5f3da..95ffa064b32b242515ad8486e08311a34b0f7fc8 100644
--- a/net/test/local_test_server.cc
+++ b/net/test/local_test_server.cc
@@ -140,9 +140,6 @@ bool LocalTestServer::Stop() {
}
bool LocalTestServer::Init(const FilePath& document_root) {
- if (document_root.IsAbsolute())
- return false;
-
// At this point, the port that the test server will listen on is unknown.
// The test server will listen on an ephemeral port, and write the port
// number out over a pipe that this TestServer object will read from. Once
@@ -153,7 +150,14 @@ bool LocalTestServer::Init(const FilePath& document_root) {
FilePath src_dir;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir))
return false;
- SetResourcePath(src_dir.Append(document_root),
+
+ FilePath root;
+ if (document_root.IsAbsolute())
+ root = document_root;
+ else
+ root = src_dir.Append(document_root);
+
+ SetResourcePath(root,
src_dir.AppendASCII("net")
.AppendASCII("data")
.AppendASCII("ssl")

Powered by Google App Engine
This is Rietveld 408576698