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

Unified Diff: net/test/local_test_server.cc

Issue 10073033: Run safebrowsing_service_test through the net testserver code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 a1a1bc876817d5245b6e5046c2d31baf72fe0a03..4768f365ec508f849b692eb65c79db229ae33917 100644
--- a/net/test/local_test_server.cc
+++ b/net/test/local_test_server.cc
@@ -94,13 +94,19 @@ bool LocalTestServer::GetTestServerDirectory(FilePath* directory) {
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"));
+ return true;
+}
+
bool LocalTestServer::Start() {
// Get path to Python server script.
FilePath testserver_path;
- if (!GetTestServerDirectory(&testserver_path))
+ if (!GetTestServerPath(&testserver_path))
return false;
- testserver_path =
- testserver_path.Append(FILE_PATH_LITERAL("testserver.py"));
if (!SetPythonPath())
return false;
@@ -159,8 +165,12 @@ bool LocalTestServer::Init(const FilePath& document_root) {
return true;
}
+bool LocalTestServer::SetPythonPath() const {
+ return SetPythonPathStatic();
+}
+
// static
-bool LocalTestServer::SetPythonPath() {
+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";
@@ -255,4 +265,13 @@ bool LocalTestServer::AddCommandLineArguments(CommandLine* command_line) const {
return true;
}
+void LocalTestServer::AddPythonArguments(const FilePath& testserver_path,
+ CommandLine* command_line) const {
+ // Make python stdout and stderr unbuffered, to prevent incomplete stderr on
+ // win bots, and also fix mixed up ordering of stdout and stderr.
+ command_line->AppendSwitch("-u");
+
+ command_line->AppendArgPath(testserver_path);
+}
+
} // namespace net
« 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