| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 8749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8760 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 8760 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 8761 ASSERT_TRUE(test_server.Start()); | 8761 ASSERT_TRUE(test_server.Start()); |
| 8762 | 8762 |
| 8763 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, | 8763 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, |
| 8764 &delegate_); | 8764 &delegate_); |
| 8765 request_->Start(); | 8765 request_->Start(); |
| 8766 | 8766 |
| 8767 base::RunLoop().Run(); | 8767 base::RunLoop().Run(); |
| 8768 } | 8768 } |
| 8769 | 8769 |
| 8770 void ExpectConnection(int version) { | |
| 8771 EXPECT_EQ(1, delegate_.response_started_count()); | |
| 8772 EXPECT_NE(0, delegate_.bytes_received()); | |
| 8773 EXPECT_EQ(version, SSLConnectionStatusToVersion( | |
| 8774 request_->ssl_info().connection_status)); | |
| 8775 EXPECT_TRUE(request_->ssl_info().connection_status & | |
| 8776 SSL_CONNECTION_VERSION_FALLBACK); | |
| 8777 } | |
| 8778 | |
| 8779 void ExpectFailure(int error) { | 8770 void ExpectFailure(int error) { |
| 8780 EXPECT_EQ(1, delegate_.response_started_count()); | 8771 EXPECT_EQ(1, delegate_.response_started_count()); |
| 8781 EXPECT_EQ(error, delegate_.request_status()); | 8772 EXPECT_EQ(error, delegate_.request_status()); |
| 8782 } | 8773 } |
| 8783 | 8774 |
| 8784 private: | 8775 private: |
| 8785 TestDelegate delegate_; | 8776 TestDelegate delegate_; |
| 8786 TestURLRequestContext context_; | 8777 TestURLRequestContext context_; |
| 8787 std::unique_ptr<URLRequest> request_; | 8778 std::unique_ptr<URLRequest> request_; |
| 8788 }; | 8779 }; |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10211 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10202 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 10212 | 10203 |
| 10213 req->Start(); | 10204 req->Start(); |
| 10214 req->Cancel(); | 10205 req->Cancel(); |
| 10215 base::RunLoop().RunUntilIdle(); | 10206 base::RunLoop().RunUntilIdle(); |
| 10216 EXPECT_EQ(ERR_ABORTED, d.request_status()); | 10207 EXPECT_EQ(ERR_ABORTED, d.request_status()); |
| 10217 EXPECT_EQ(0, d.received_redirect_count()); | 10208 EXPECT_EQ(0, d.received_redirect_count()); |
| 10218 } | 10209 } |
| 10219 | 10210 |
| 10220 } // namespace net | 10211 } // namespace net |
| OLD | NEW |