Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Side by Side Diff: net/http/http_stream_factory_impl_unittest.cc

Issue 1862193002: Enable QUIC for proxies only when QUIC is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sclittle comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 ERR_SSL_PROTOCOL_ERROR, 677 ERR_SSL_PROTOCOL_ERROR,
678 ERR_MSG_TOO_BIG}; 678 ERR_MSG_TOO_BIG};
679 for (size_t i = 0; i < arraysize(mock_error); ++i) { 679 for (size_t i = 0; i < arraysize(mock_error); ++i) {
680 std::unique_ptr<ProxyService> proxy_service; 680 std::unique_ptr<ProxyService> proxy_service;
681 proxy_service = 681 proxy_service =
682 ProxyService::CreateFixedFromPacResult("QUIC bad:99; DIRECT"); 682 ProxyService::CreateFixedFromPacResult("QUIC bad:99; DIRECT");
683 683
684 HttpNetworkSession::Params params; 684 HttpNetworkSession::Params params;
685 params.enable_quic = true; 685 params.enable_quic = true;
686 params.quic_disable_preconnect_if_0rtt = false; 686 params.quic_disable_preconnect_if_0rtt = false;
687 params.enable_quic_for_proxies = true;
688 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service( 687 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service(
689 new SSLConfigServiceDefaults); 688 new SSLConfigServiceDefaults);
690 HttpServerPropertiesImpl http_server_properties; 689 HttpServerPropertiesImpl http_server_properties;
691 MockClientSocketFactory socket_factory; 690 MockClientSocketFactory socket_factory;
692 params.client_socket_factory = &socket_factory; 691 params.client_socket_factory = &socket_factory;
693 MockHostResolver host_resolver; 692 MockHostResolver host_resolver;
694 params.host_resolver = &host_resolver; 693 params.host_resolver = &host_resolver;
695 TransportSecurityState transport_security_state; 694 TransportSecurityState transport_security_state;
696 params.transport_security_state = &transport_security_state; 695 params.transport_security_state = &transport_security_state;
697 params.proxy_service = proxy_service.get(); 696 params.proxy_service = proxy_service.get();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 800
802 } // namespace 801 } // namespace
803 802
804 TEST_P(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad) { 803 TEST_P(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad) {
805 // Checks if a 804 // Checks if a
806 std::unique_ptr<ProxyService> proxy_service; 805 std::unique_ptr<ProxyService> proxy_service;
807 proxy_service = ProxyService::CreateFixedFromPacResult("QUIC bad:99; DIRECT"); 806 proxy_service = ProxyService::CreateFixedFromPacResult("QUIC bad:99; DIRECT");
808 807
809 HttpNetworkSession::Params params; 808 HttpNetworkSession::Params params;
810 params.enable_quic = true; 809 params.enable_quic = true;
811 params.enable_quic_for_proxies = true;
812 params.quic_disable_preconnect_if_0rtt = false; 810 params.quic_disable_preconnect_if_0rtt = false;
813 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service( 811 scoped_refptr<SSLConfigServiceDefaults> ssl_config_service(
814 new SSLConfigServiceDefaults); 812 new SSLConfigServiceDefaults);
815 HttpServerPropertiesImpl http_server_properties; 813 HttpServerPropertiesImpl http_server_properties;
816 MockClientSocketFactory socket_factory; 814 MockClientSocketFactory socket_factory;
817 params.client_socket_factory = &socket_factory; 815 params.client_socket_factory = &socket_factory;
818 MockHostResolver host_resolver; 816 MockHostResolver host_resolver;
819 params.host_resolver = &host_resolver; 817 params.host_resolver = &host_resolver;
820 TransportSecurityState transport_security_state; 818 TransportSecurityState transport_security_state;
821 params.transport_security_state = &transport_security_state; 819 params.transport_security_state = &transport_security_state;
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 2015 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
2018 2016
2019 // Make sure there is no orphaned job. it is already canceled. 2017 // Make sure there is no orphaned job. it is already canceled.
2020 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( 2018 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>(
2021 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); 2019 session->http_stream_factory_for_websocket())->num_orphaned_jobs());
2022 } 2020 }
2023 2021
2024 } // namespace 2022 } // namespace
2025 2023
2026 } // namespace net 2024 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698