OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 void SetUpOnMainThread() override { | 306 void SetUpOnMainThread() override { |
307 // This must be created after the main message loop has been set up. | 307 // This must be created after the main message loop has been set up. |
308 // Waits for one connection. Additional connections are fine. | 308 // Waits for one connection. Additional connections are fine. |
309 connection_listener_ = | 309 connection_listener_ = |
310 base::MakeUnique<net::test_server::SimpleConnectionListener>( | 310 base::MakeUnique<net::test_server::SimpleConnectionListener>( |
311 1, net::test_server::SimpleConnectionListener:: | 311 1, net::test_server::SimpleConnectionListener:: |
312 ALLOW_ADDITIONAL_CONNECTIONS); | 312 ALLOW_ADDITIONAL_CONNECTIONS); |
313 embedded_test_server()->SetConnectionListener(connection_listener_.get()); | 313 embedded_test_server()->SetConnectionListener(connection_listener_.get()); |
314 embedded_test_server()->StartAcceptingConnections(); | 314 embedded_test_server()->StartAcceptingConnections(); |
315 | |
316 InProcessBrowserTest::SetUpOnMainThread(); | |
317 } | 315 } |
318 | 316 |
319 void SetUpCommandLine(base::CommandLine* command_line) override { | 317 void SetUpCommandLine(base::CommandLine* command_line) override { |
320 command_line->AppendSwitchASCII( | 318 command_line->AppendSwitchASCII( |
321 switches::kProxyPacUrl, embedded_test_server()->GetURL("/hung").spec()); | 319 switches::kProxyPacUrl, embedded_test_server()->GetURL("/hung").spec()); |
322 } | 320 } |
323 | 321 |
324 protected: | 322 protected: |
325 std::unique_ptr<net::test_server::SimpleConnectionListener> | 323 std::unique_ptr<net::test_server::SimpleConnectionListener> |
326 connection_listener_; | 324 connection_listener_; |
(...skipping 27 matching lines...) Expand all Loading... |
354 std::unique_ptr<net::URLFetcher> hanging_fetcher = net::URLFetcher::Create( | 352 std::unique_ptr<net::URLFetcher> hanging_fetcher = net::URLFetcher::Create( |
355 GURL("http://blah/"), net::URLFetcher::GET, &hanging_request_delegate, | 353 GURL("http://blah/"), net::URLFetcher::GET, &hanging_request_delegate, |
356 TRAFFIC_ANNOTATION_FOR_TESTS); | 354 TRAFFIC_ANNOTATION_FOR_TESTS); |
357 hanging_fetcher->SetRequestContext(browser()->profile()->GetRequestContext()); | 355 hanging_fetcher->SetRequestContext(browser()->profile()->GetRequestContext()); |
358 hanging_fetcher->Start(); | 356 hanging_fetcher->Start(); |
359 | 357 |
360 connection_listener_->WaitForConnections(); | 358 connection_listener_->WaitForConnections(); |
361 } | 359 } |
362 | 360 |
363 } // namespace | 361 } // namespace |
OLD | NEW |