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

Side by Side Diff: net/test/test_server_posix.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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <poll.h> 7 #include <poll.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return false; 86 return false;
87 bytes_read += num_bytes; 87 bytes_read += num_bytes;
88 } 88 }
89 return true; 89 return true;
90 } 90 }
91 91
92 } // namespace 92 } // namespace
93 93
94 namespace net { 94 namespace net {
95 95
96 // static
97 FilePath TestServer::GetAbsolutePythonCommandPath() {
98 return FilePath(FILE_PATH_LITERAL("python"));
99 }
100
96 bool TestServer::LaunchPython(const FilePath& testserver_path) { 101 bool TestServer::LaunchPython(const FilePath& testserver_path) {
97 CommandLine python_command(FilePath(FILE_PATH_LITERAL("python"))); 102 CommandLine python_command(GetAbsolutePythonCommandPath());
98 python_command.AppendArgPath(testserver_path); 103 python_command.AppendArgPath(testserver_path);
99 if (!AddCommandLineArguments(&python_command)) 104 if (!AddCommandLineArguments(&python_command))
100 return false; 105 return false;
101 106
102 int pipefd[2]; 107 int pipefd[2];
103 if (pipe(pipefd) != 0) { 108 if (pipe(pipefd) != 0) {
104 PLOG(ERROR) << "Could not create pipe."; 109 PLOG(ERROR) << "Could not create pipe.";
105 return false; 110 return false;
106 } 111 }
107 112
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 161
157 if (!ParseServerData(server_data)) { 162 if (!ParseServerData(server_data)) {
158 LOG(ERROR) << "Could not parse server_data: " << server_data; 163 LOG(ERROR) << "Could not parse server_data: " << server_data;
159 return false; 164 return false;
160 } 165 }
161 166
162 return true; 167 return true;
163 } 168 }
164 169
165 } // namespace net 170 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698