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

Unified Diff: net/test/local_test_server.cc

Issue 11971025: [sync] Divorce python sync test server chromiumsync.py from testserver.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 11 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/remote_test_server.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 5e1e0e93765030d3ec3651465ec99e3cf0c20b71..cd0cadd4a0ad062ea4c4983fe3995951144f6af3 100644
--- a/net/test/local_test_server.cc
+++ b/net/test/local_test_server.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -77,28 +77,16 @@ LocalTestServer::~LocalTestServer() {
Stop();
}
-// static
-bool LocalTestServer::GetTestServerDirectory(FilePath* directory) {
- // Get path to python server script.
+bool LocalTestServer::GetTestServerPath(FilePath* testserver_path) const {
FilePath testserver_dir;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &testserver_dir)) {
LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
return false;
}
-
- testserver_dir = testserver_dir
- .Append(FILE_PATH_LITERAL("net"))
- .Append(FILE_PATH_LITERAL("tools"))
- .Append(FILE_PATH_LITERAL("testserver"));
- *directory = testserver_dir;
- return true;
-}
-
-bool LocalTestServer::GetTestServerPath(FilePath* testserver_path) const {
- if (!GetTestServerDirectory(testserver_path))
- return false;
- *testserver_path = testserver_path->Append(FILE_PATH_LITERAL(
- "testserver.py"));
+ testserver_dir = testserver_dir.Append(FILE_PATH_LITERAL("net"))
+ .Append(FILE_PATH_LITERAL("tools"))
+ .Append(FILE_PATH_LITERAL("testserver"));
+ *testserver_path = testserver_dir.Append(FILE_PATH_LITERAL("testserver.py"));
return true;
}
@@ -166,11 +154,6 @@ bool LocalTestServer::Init(const FilePath& document_root) {
}
bool LocalTestServer::SetPythonPath() const {
- return SetPythonPathStatic();
-}
-
-// static
-bool LocalTestServer::SetPythonPathStatic() {
FilePath third_party_dir;
if (!PathService::Get(base::DIR_SOURCE_ROOT, &third_party_dir)) {
LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
@@ -196,9 +179,10 @@ bool LocalTestServer::SetPythonPathStatic() {
<< "Testserver features that rely on it will not work";
return true;
}
-
AppendToPythonPath(pyproto_dir);
- AppendToPythonPath(pyproto_dir.AppendASCII("sync").AppendASCII("protocol"));
+
+ // TODO(cloud_policy): Move this out of net/, since net/ should not have to
+ // depend on chrome/. See http://crbug.com/119403.
AppendToPythonPath(pyproto_dir.AppendASCII("chrome")
.AppendASCII("browser")
.AppendASCII("policy")
@@ -235,19 +219,17 @@ bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const {
// Append the appropriate server type argument.
switch (type()) {
- case TYPE_HTTP:
+ case TYPE_HTTP: // The default type is HTTP, no argument required.
+ break;
case TYPE_HTTPS:
- // The default type is HTTP, no argument required.
+ command_line->AppendArg("--https");
break;
case TYPE_WS:
case TYPE_WSS:
command_line->AppendArg("--websocket");
break;
case TYPE_FTP:
- command_line->AppendArg("-f");
- break;
- case TYPE_SYNC:
- command_line->AppendArg("--sync");
+ command_line->AppendArg("--ftp");
break;
case TYPE_TCP_ECHO:
command_line->AppendArg("--tcp-echo");
« no previous file with comments | « net/test/local_test_server.h ('k') | net/test/remote_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698