Chromium Code Reviews| 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 8740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8751 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); | 8751 base::FilePath(FILE_PATH_LITERAL("net/data/ssl"))); |
| 8752 ASSERT_TRUE(test_server.Start()); | 8752 ASSERT_TRUE(test_server.Start()); |
| 8753 | 8753 |
| 8754 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, | 8754 request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY, |
| 8755 &delegate_); | 8755 &delegate_); |
| 8756 request_->Start(); | 8756 request_->Start(); |
| 8757 | 8757 |
| 8758 base::RunLoop().Run(); | 8758 base::RunLoop().Run(); |
| 8759 } | 8759 } |
| 8760 | 8760 |
| 8761 void ExpectConnection(int version) { | |
| 8762 EXPECT_EQ(1, delegate_.response_started_count()); | |
| 8763 EXPECT_NE(0, delegate_.bytes_received()); | |
| 8764 EXPECT_EQ(version, SSLConnectionStatusToVersion( | |
| 8765 request_->ssl_info().connection_status)); | |
| 8766 EXPECT_TRUE(request_->ssl_info().connection_status & | |
| 8767 SSL_CONNECTION_VERSION_FALLBACK); | |
|
mmenke
2016/10/03 16:01:03
Can we remove SSL_CONNECTION_VERSION_FALLBACK?
davidben
2016/10/03 19:09:24
Done.
| |
| 8768 } | |
| 8769 | |
| 8770 void ExpectFailure(int error) { | 8761 void ExpectFailure(int error) { |
| 8771 EXPECT_EQ(1, delegate_.response_started_count()); | 8762 EXPECT_EQ(1, delegate_.response_started_count()); |
| 8772 EXPECT_EQ(error, delegate_.request_status()); | 8763 EXPECT_EQ(error, delegate_.request_status()); |
| 8773 } | 8764 } |
| 8774 | 8765 |
| 8775 private: | 8766 private: |
| 8776 TestDelegate delegate_; | 8767 TestDelegate delegate_; |
| 8777 TestURLRequestContext context_; | 8768 TestURLRequestContext context_; |
| 8778 std::unique_ptr<URLRequest> request_; | 8769 std::unique_ptr<URLRequest> request_; |
| 8779 }; | 8770 }; |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10202 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10193 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 10203 | 10194 |
| 10204 req->Start(); | 10195 req->Start(); |
| 10205 req->Cancel(); | 10196 req->Cancel(); |
| 10206 base::RunLoop().RunUntilIdle(); | 10197 base::RunLoop().RunUntilIdle(); |
| 10207 EXPECT_EQ(ERR_ABORTED, d.request_status()); | 10198 EXPECT_EQ(ERR_ABORTED, d.request_status()); |
| 10208 EXPECT_EQ(0, d.received_redirect_count()); | 10199 EXPECT_EQ(0, d.received_redirect_count()); |
| 10209 } | 10200 } |
| 10210 | 10201 |
| 10211 } // namespace net | 10202 } // namespace net |
| OLD | NEW |