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

Side by Side Diff: net/test/spawned_test_server/local_test_server_posix.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
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/spawned_test_server/local_test_server.h" 5 #include "net/test/spawned_test_server/local_test_server.h"
6 6
7 #include <poll.h> 7 #include <poll.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 OrphanedTestServerFilter filter(testserver_path.value(), 132 OrphanedTestServerFilter filter(testserver_path.value(),
133 base::IntToString(GetPort())); 133 base::IntToString(GetPort()));
134 if (!base::KillProcesses("python", -1, &filter)) { 134 if (!base::KillProcesses("python", -1, &filter)) {
135 LOG(WARNING) << "Failed to clean up older orphaned testserver instances."; 135 LOG(WARNING) << "Failed to clean up older orphaned testserver instances.";
136 } 136 }
137 137
138 // Launch a new testserver process. 138 // Launch a new testserver process.
139 base::LaunchOptions options; 139 base::LaunchOptions options;
140 140
141 options.fds_to_remap = &map_write_fd; 141 options.fds_to_remap = &map_write_fd;
142 if (!base::LaunchProcess(python_command, options, &process_handle_)) { 142 process_ = base::LaunchProcess(python_command, options);
143 if (!process_.IsValid()) {
143 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); 144 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString();
144 return false; 145 return false;
145 } 146 }
146 147
147 return true; 148 return true;
148 } 149 }
149 150
150 bool LocalTestServer::WaitToStart() { 151 bool LocalTestServer::WaitToStart() {
151 base::ScopedFD our_fd(child_fd_.release()); 152 base::ScopedFD our_fd(child_fd_.release());
152 153
(...skipping 17 matching lines...) Expand all
170 171
171 if (!ParseServerData(server_data)) { 172 if (!ParseServerData(server_data)) {
172 LOG(ERROR) << "Could not parse server_data: " << server_data; 173 LOG(ERROR) << "Could not parse server_data: " << server_data;
173 return false; 174 return false;
174 } 175 }
175 176
176 return true; 177 return true;
177 } 178 }
178 179
179 } // namespace net 180 } // namespace net
OLDNEW
« no previous file with comments | « net/test/spawned_test_server/local_test_server.cc ('k') | net/test/spawned_test_server/local_test_server_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698