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

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

Issue 10692155: Switch to TimeDelta interfaces for process waiting functions in net and ipc. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
« no previous file with comments | « net/test/local_test_server.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/local_test_server.h" 5 #include "net/test/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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString(); 134 LOG(ERROR) << "Failed to launch " << python_command.GetCommandLineString();
135 return false; 135 return false;
136 } 136 }
137 137
138 return true; 138 return true;
139 } 139 }
140 140
141 bool LocalTestServer::WaitToStart() { 141 bool LocalTestServer::WaitToStart() {
142 file_util::ScopedFD child_fd_closer(child_fd_closer_.release()); 142 file_util::ScopedFD child_fd_closer(child_fd_closer_.release());
143 143
144 base::TimeDelta remaining_time = base::TimeDelta::FromMilliseconds( 144 base::TimeDelta remaining_time = TestTimeouts::action_timeout();
145 TestTimeouts::action_timeout_ms());
146 145
147 uint32 server_data_len = 0; 146 uint32 server_data_len = 0;
148 if (!ReadData(child_fd_, sizeof(server_data_len), 147 if (!ReadData(child_fd_, sizeof(server_data_len),
149 reinterpret_cast<uint8*>(&server_data_len), 148 reinterpret_cast<uint8*>(&server_data_len),
150 &remaining_time)) { 149 &remaining_time)) {
151 LOG(ERROR) << "Could not read server_data_len"; 150 LOG(ERROR) << "Could not read server_data_len";
152 return false; 151 return false;
153 } 152 }
154 std::string server_data(server_data_len, '\0'); 153 std::string server_data(server_data_len, '\0');
155 if (!ReadData(child_fd_, server_data_len, 154 if (!ReadData(child_fd_, server_data_len,
156 reinterpret_cast<uint8*>(&server_data[0]), 155 reinterpret_cast<uint8*>(&server_data[0]),
157 &remaining_time)) { 156 &remaining_time)) {
158 LOG(ERROR) << "Could not read server_data (" << server_data_len 157 LOG(ERROR) << "Could not read server_data (" << server_data_len
159 << " bytes)"; 158 << " bytes)";
160 return false; 159 return false;
161 } 160 }
162 161
163 if (!ParseServerData(server_data)) { 162 if (!ParseServerData(server_data)) {
164 LOG(ERROR) << "Could not parse server_data: " << server_data; 163 LOG(ERROR) << "Could not parse server_data: " << server_data;
165 return false; 164 return false;
166 } 165 }
167 166
168 return true; 167 return true;
169 } 168 }
170 169
171 } // namespace net 170 } // namespace net
OLDNEW
« no previous file with comments | « net/test/local_test_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698