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

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

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/remote_test_server.h" 5 #include "net/test/spawned_test_server/remote_test_server.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 bool RemoteTestServer::Init(const base::FilePath& document_root) { 163 bool RemoteTestServer::Init(const base::FilePath& document_root) {
164 if (document_root.IsAbsolute()) 164 if (document_root.IsAbsolute())
165 return false; 165 return false;
166 166
167 // Gets ports information used by test server spawner and Python test server. 167 // Gets ports information used by test server spawner and Python test server.
168 int test_server_port = 0; 168 int test_server_port = 0;
169 169
170 // Parse file to extract the ports information. 170 // Parse file to extract the ports information.
171 std::string port_info; 171 std::string port_info;
172 if (!file_util::ReadFileToString(GetTestServerPortInfoFile(), 172 if (!base::ReadFileToString(GetTestServerPortInfoFile(), &port_info) ||
173 &port_info) ||
174 port_info.empty()) { 173 port_info.empty()) {
175 return false; 174 return false;
176 } 175 }
177 176
178 std::vector<std::string> ports; 177 std::vector<std::string> ports;
179 base::SplitString(port_info, ':', &ports); 178 base::SplitString(port_info, ':', &ports);
180 if (ports.size() != 2u) 179 if (ports.size() != 2u)
181 return false; 180 return false;
182 181
183 // Verify the ports information. 182 // Verify the ports information.
(...skipping 11 matching lines...) Expand all
195 194
196 SetResourcePath(document_root, base::FilePath().AppendASCII("net") 195 SetResourcePath(document_root, base::FilePath().AppendASCII("net")
197 .AppendASCII("data") 196 .AppendASCII("data")
198 .AppendASCII("ssl") 197 .AppendASCII("ssl")
199 .AppendASCII("certificates")); 198 .AppendASCII("certificates"));
200 return true; 199 return true;
201 } 200 }
202 201
203 } // namespace net 202 } // namespace net
204 203
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.cc ('k') | net/tools/crl_set_dump/crl_set_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698