| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 // Cleanup manager. | 699 // Cleanup manager. |
| 700 sdch_manager.RemoveObserver(&sdch_observer); | 700 sdch_manager.RemoveObserver(&sdch_observer); |
| 701 } | 701 } |
| 702 | 702 |
| 703 class URLRequestHttpJobWithBrotliSupportTest : public ::testing::Test { | 703 class URLRequestHttpJobWithBrotliSupportTest : public ::testing::Test { |
| 704 protected: | 704 protected: |
| 705 URLRequestHttpJobWithBrotliSupportTest() | 705 URLRequestHttpJobWithBrotliSupportTest() |
| 706 : context_(new TestURLRequestContext(true)) { | 706 : context_(new TestURLRequestContext(true)) { |
| 707 std::unique_ptr<HttpNetworkSession::Params> params( | 707 std::unique_ptr<HttpNetworkSession::Params> params( |
| 708 new HttpNetworkSession::Params); | 708 new HttpNetworkSession::Params); |
| 709 params->enable_brotli = true; | 709 context_->set_enable_brotli(true); |
| 710 context_->set_http_network_session_params(std::move(params)); | 710 context_->set_http_network_session_params(std::move(params)); |
| 711 context_->set_client_socket_factory(&socket_factory_); | 711 context_->set_client_socket_factory(&socket_factory_); |
| 712 context_->Init(); | 712 context_->Init(); |
| 713 } | 713 } |
| 714 | 714 |
| 715 MockClientSocketFactory socket_factory_; | 715 MockClientSocketFactory socket_factory_; |
| 716 std::unique_ptr<TestURLRequestContext> context_; | 716 std::unique_ptr<TestURLRequestContext> context_; |
| 717 }; | 717 }; |
| 718 | 718 |
| 719 TEST_F(URLRequestHttpJobWithBrotliSupportTest, NoBrotliAdvertisementOverHttp) { | 719 TEST_F(URLRequestHttpJobWithBrotliSupportTest, NoBrotliAdvertisementOverHttp) { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 base::RunLoop().RunUntilIdle(); | 940 base::RunLoop().RunUntilIdle(); |
| 941 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); | 941 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); |
| 942 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); | 942 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); |
| 943 } | 943 } |
| 944 | 944 |
| 945 #endif // !defined(OS_IOS) | 945 #endif // !defined(OS_IOS) |
| 946 | 946 |
| 947 } // namespace | 947 } // namespace |
| 948 | 948 |
| 949 } // namespace net | 949 } // namespace net |
| OLD | NEW |