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 "net/test/embedded_test_server/embedded_test_server.h" | 5 #include "net/test/embedded_test_server/embedded_test_server.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 552 |
553 // Make a request and wait for the reply. | 553 // Make a request and wait for the reply. |
554 if (!loop) | 554 if (!loop) |
555 loop.reset(new base::MessageLoopForIO); | 555 loop.reset(new base::MessageLoopForIO); |
556 | 556 |
557 std::unique_ptr<URLFetcher> fetcher = | 557 std::unique_ptr<URLFetcher> fetcher = |
558 URLFetcher::Create(server.GetURL("/test?q=foo"), URLFetcher::GET, this); | 558 URLFetcher::Create(server.GetURL("/test?q=foo"), URLFetcher::GET, this); |
559 fetcher->SetRequestContext( | 559 fetcher->SetRequestContext( |
560 new TestURLRequestContextGetter(loop->task_runner())); | 560 new TestURLRequestContextGetter(loop->task_runner())); |
561 fetcher->Start(); | 561 fetcher->Start(); |
562 loop->Run(); | 562 base::RunLoop().Run(); |
563 fetcher.reset(); | 563 fetcher.reset(); |
564 | 564 |
565 // Shut down. | 565 // Shut down. |
566 if (message_loop_present_on_shutdown_) | 566 if (message_loop_present_on_shutdown_) |
567 loop.reset(); | 567 loop.reset(); |
568 | 568 |
569 ASSERT_TRUE(server.ShutdownAndWaitUntilComplete()); | 569 ASSERT_TRUE(server.ShutdownAndWaitUntilComplete()); |
570 } | 570 } |
571 | 571 |
572 // URLFetcherDelegate override. | 572 // URLFetcherDelegate override. |
(...skipping 24 matching lines...) Expand all Loading... |
597 INSTANTIATE_TEST_CASE_P( | 597 INSTANTIATE_TEST_CASE_P( |
598 EmbeddedTestServerThreadingTestInstantiation, | 598 EmbeddedTestServerThreadingTestInstantiation, |
599 EmbeddedTestServerThreadingTest, | 599 EmbeddedTestServerThreadingTest, |
600 testing::Combine(testing::Bool(), | 600 testing::Combine(testing::Bool(), |
601 testing::Bool(), | 601 testing::Bool(), |
602 testing::Values(EmbeddedTestServer::TYPE_HTTP, | 602 testing::Values(EmbeddedTestServer::TYPE_HTTP, |
603 EmbeddedTestServer::TYPE_HTTPS))); | 603 EmbeddedTestServer::TYPE_HTTPS))); |
604 | 604 |
605 } // namespace test_server | 605 } // namespace test_server |
606 } // namespace net | 606 } // namespace net |
OLD | NEW |