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

Unified Diff: net/test/local_test_server.cc

Issue 9545019: Add "run_testserver --sync-test" for easy chromiumsync_test.py launching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert a few files Created 8 years, 9 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
« no previous file with comments | « net/test/local_test_server.h ('k') | net/test/local_test_server_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/local_test_server.cc
diff --git a/net/test/local_test_server.cc b/net/test/local_test_server.cc
index 463cd809a6e7b7446c573ae120dd46529087dded..7fe3e589ee305dc9794b62d7b5847c8b7d03220d 100644
--- a/net/test/local_test_server.cc
+++ b/net/test/local_test_server.cc
@@ -76,18 +76,30 @@ LocalTestServer::~LocalTestServer() {
Stop();
}
-bool LocalTestServer::Start() {
- // Get path to Python server script.
- FilePath testserver_path;
- if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_path)) {
+// static
+bool LocalTestServer::GetTestServerDirectory(FilePath* directory) {
+ // Get path to python server script.
+ FilePath testserver_dir;
+ if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) {
LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
return false;
}
- testserver_path = testserver_path
+
+ testserver_dir = testserver_dir
.Append(FILE_PATH_LITERAL("net"))
.Append(FILE_PATH_LITERAL("tools"))
- .Append(FILE_PATH_LITERAL("testserver"))
- .Append(FILE_PATH_LITERAL("testserver.py"));
+ .Append(FILE_PATH_LITERAL("testserver"));
+ *directory = testserver_dir;
+ return true;
+}
+
+bool LocalTestServer::Start() {
+ // Get path to Python server script.
+ FilePath testserver_path;
+ if (!GetTestServerDirectory(&testserver_path))
+ return false;
+ testserver_path =
+ testserver_path.Append(FILE_PATH_LITERAL("testserver.py"));
if (!SetPythonPath())
return false;
@@ -146,7 +158,8 @@ bool LocalTestServer::Init(const FilePath& document_root) {
return true;
}
-bool LocalTestServer::SetPythonPath() const {
+// static
+bool LocalTestServer::SetPythonPath() {
FilePath third_party_dir;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &third_party_dir)) {
LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
« no previous file with comments | « net/test/local_test_server.h ('k') | net/test/local_test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698