| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 base::WeakPtrFactory<InfiniteResponse> weak_ptr_factory_; | 439 base::WeakPtrFactory<InfiniteResponse> weak_ptr_factory_; |
| 440 | 440 |
| 441 DISALLOW_COPY_AND_ASSIGN(InfiniteResponse); | 441 DISALLOW_COPY_AND_ASSIGN(InfiniteResponse); |
| 442 }; | 442 }; |
| 443 | 443 |
| 444 std::unique_ptr<HttpResponse> HandleInfiniteRequest( | 444 std::unique_ptr<HttpResponse> HandleInfiniteRequest( |
| 445 const HttpRequest& request) { | 445 const HttpRequest& request) { |
| 446 return base::WrapUnique(new InfiniteResponse); | 446 return base::WrapUnique(new InfiniteResponse); |
| 447 } | 447 } |
| 448 } | 448 |
| 449 } // anonymous namespace |
| 449 | 450 |
| 450 // Tests the case the connection is closed while the server is sending a | 451 // Tests the case the connection is closed while the server is sending a |
| 451 // response. May non-deterministically end up at one of three paths | 452 // response. May non-deterministically end up at one of three paths |
| 452 // (Discover the close event synchronously, asynchronously, or server | 453 // (Discover the close event synchronously, asynchronously, or server |
| 453 // shutting down before it is discovered). | 454 // shutting down before it is discovered). |
| 454 TEST_P(EmbeddedTestServerTest, CloseDuringWrite) { | 455 TEST_P(EmbeddedTestServerTest, CloseDuringWrite) { |
| 455 CancelRequestDelegate cancel_delegate; | 456 CancelRequestDelegate cancel_delegate; |
| 456 TestURLRequestContext context; | 457 TestURLRequestContext context; |
| 457 cancel_delegate.set_cancel_in_response_started(true); | 458 cancel_delegate.set_cancel_in_response_started(true); |
| 458 server_->RegisterRequestHandler(base::Bind( | 459 server_->RegisterRequestHandler(base::Bind( |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 INSTANTIATE_TEST_CASE_P( | 614 INSTANTIATE_TEST_CASE_P( |
| 614 EmbeddedTestServerThreadingTestInstantiation, | 615 EmbeddedTestServerThreadingTestInstantiation, |
| 615 EmbeddedTestServerThreadingTest, | 616 EmbeddedTestServerThreadingTest, |
| 616 testing::Combine(testing::Bool(), | 617 testing::Combine(testing::Bool(), |
| 617 testing::Bool(), | 618 testing::Bool(), |
| 618 testing::Values(EmbeddedTestServer::TYPE_HTTP, | 619 testing::Values(EmbeddedTestServer::TYPE_HTTP, |
| 619 EmbeddedTestServer::TYPE_HTTPS))); | 620 EmbeddedTestServer::TYPE_HTTPS))); |
| 620 | 621 |
| 621 } // namespace test_server | 622 } // namespace test_server |
| 622 } // namespace net | 623 } // namespace net |
| OLD | NEW |