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

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

Issue 2175933002: More aggressive IO asserts in content_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 1 less instance of ScopedAllowIO in DumpAccessibilityTestBase::RunTestForPlatform. Created 4 years, 4 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/embedded_test_server/embedded_test_server.cc ('k') | net/test/test_data_directory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/local_test_server.h" 5 #include "net/test/spawned_test_server/local_test_server.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/threading/thread_restrictions.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 #include "net/base/host_port_pair.h" 14 #include "net/base/host_port_pair.h"
14 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
15 #include "net/test/python_utils.h" 16 #include "net/test/python_utils.h"
16 #include "url/gurl.h" 17 #include "url/gurl.h"
17 18
18 namespace net { 19 namespace net {
19 20
20 namespace { 21 namespace {
21 22
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 .Append(FILE_PATH_LITERAL("testserver")); 88 .Append(FILE_PATH_LITERAL("testserver"));
88 *testserver_path = testserver_dir.Append(FILE_PATH_LITERAL("testserver.py")); 89 *testserver_path = testserver_dir.Append(FILE_PATH_LITERAL("testserver.py"));
89 return true; 90 return true;
90 } 91 }
91 92
92 bool LocalTestServer::Start() { 93 bool LocalTestServer::Start() {
93 return StartInBackground() && BlockUntilStarted(); 94 return StartInBackground() && BlockUntilStarted();
94 } 95 }
95 96
96 bool LocalTestServer::StartInBackground() { 97 bool LocalTestServer::StartInBackground() {
98 base::ThreadRestrictions::ScopedAllowIO allow_io_from_test_code;
99
97 // Get path to Python server script. 100 // Get path to Python server script.
98 base::FilePath testserver_path; 101 base::FilePath testserver_path;
99 if (!GetTestServerPath(&testserver_path)) 102 if (!GetTestServerPath(&testserver_path))
100 return false; 103 return false;
101 104
102 if (!SetPythonPath()) 105 if (!SetPythonPath())
103 return false; 106 return false;
104 107
105 if (!LaunchPython(testserver_path)) 108 if (!LaunchPython(testserver_path))
106 return false; 109 return false;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 break; 244 break;
242 default: 245 default:
243 NOTREACHED(); 246 NOTREACHED();
244 return false; 247 return false;
245 } 248 }
246 249
247 return true; 250 return true;
248 } 251 }
249 252
250 } // namespace net 253 } // namespace net
OLDNEW
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.cc ('k') | net/test/test_data_directory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698