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

Side by Side Diff: net/quic/quic_network_transaction_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 <memory> 5 #include <memory>
6 #include <ostream> 6 #include <ostream>
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 entries, 0, NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED, 748 entries, 0, NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED,
749 NetLog::PHASE_NONE); 749 NetLog::PHASE_NONE);
750 EXPECT_LT(0, pos); 750 EXPECT_LT(0, pos);
751 751
752 int log_stream_id; 752 int log_stream_id;
753 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id)); 753 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id));
754 EXPECT_EQ(3, log_stream_id); 754 EXPECT_EQ(3, log_stream_id);
755 } 755 }
756 756
757 TEST_P(QuicNetworkTransactionTest, QuicProxy) { 757 TEST_P(QuicNetworkTransactionTest, QuicProxy) {
758 params_.enable_quic_for_proxies = true; 758 params_.enable_quic = true;
759 proxy_service_ = 759 proxy_service_ =
760 ProxyService::CreateFixedFromPacResult("QUIC mail.example.org:70"); 760 ProxyService::CreateFixedFromPacResult("QUIC mail.example.org:70");
761 761
762 MockQuicData mock_quic_data; 762 MockQuicData mock_quic_data;
763 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( 763 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
764 1, kClientDataStreamId1, true, true, 764 1, kClientDataStreamId1, true, true,
765 GetRequestHeaders("GET", "http", "/"))); 765 GetRequestHeaders("GET", "http", "/")));
766 mock_quic_data.AddRead(ConstructServerResponseHeadersPacket( 766 mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
767 1, kClientDataStreamId1, false, false, GetResponseHeaders("200 OK"))); 767 1, kClientDataStreamId1, false, false, GetResponseHeaders("200 OK")));
768 mock_quic_data.AddRead(ConstructServerDataPacket(2, kClientDataStreamId1, 768 mock_quic_data.AddRead(ConstructServerDataPacket(2, kClientDataStreamId1,
(...skipping 18 matching lines...) Expand all
787 test_socket_performance_watcher_factory_.rtt_notification_received()); 787 test_socket_performance_watcher_factory_.rtt_notification_received());
788 } 788 }
789 789
790 // Regression test for https://crbug.com/492458. Test that for an HTTP 790 // Regression test for https://crbug.com/492458. Test that for an HTTP
791 // connection through a QUIC proxy, the certificate exhibited by the proxy is 791 // connection through a QUIC proxy, the certificate exhibited by the proxy is
792 // checked against the proxy hostname, not the origin hostname. 792 // checked against the proxy hostname, not the origin hostname.
793 TEST_P(QuicNetworkTransactionTest, QuicProxyWithCert) { 793 TEST_P(QuicNetworkTransactionTest, QuicProxyWithCert) {
794 const std::string origin_host = "mail.example.com"; 794 const std::string origin_host = "mail.example.com";
795 const std::string proxy_host = "www.example.org"; 795 const std::string proxy_host = "www.example.org";
796 796
797 params_.enable_quic_for_proxies = true; 797 params_.enable_quic = true;
798 proxy_service_ = 798 proxy_service_ =
799 ProxyService::CreateFixedFromPacResult("QUIC " + proxy_host + ":70"); 799 ProxyService::CreateFixedFromPacResult("QUIC " + proxy_host + ":70");
800 800
801 client_maker_.set_hostname(origin_host); 801 client_maker_.set_hostname(origin_host);
802 MockQuicData mock_quic_data; 802 MockQuicData mock_quic_data;
803 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( 803 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
804 1, kClientDataStreamId1, true, true, 804 1, kClientDataStreamId1, true, true,
805 GetRequestHeaders("GET", "http", "/"))); 805 GetRequestHeaders("GET", "http", "/")));
806 mock_quic_data.AddRead(ConstructServerResponseHeadersPacket( 806 mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
807 1, kClientDataStreamId1, false, false, GetResponseHeaders("200 OK"))); 807 1, kClientDataStreamId1, false, false, GetResponseHeaders("200 OK")));
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 AddHangingSocketData(); 2712 AddHangingSocketData();
2713 2713
2714 SendRequestAndExpectQuicResponse(origin1_); 2714 SendRequestAndExpectQuicResponse(origin1_);
2715 SendRequestAndExpectQuicResponse(origin2_); 2715 SendRequestAndExpectQuicResponse(origin2_);
2716 2716
2717 EXPECT_TRUE(AllDataConsumed()); 2717 EXPECT_TRUE(AllDataConsumed());
2718 } 2718 }
2719 2719
2720 } // namespace test 2720 } // namespace test
2721 } // namespace net 2721 } // namespace net
OLDNEW
« chrome/browser/io_thread.cc ('K') | « net/http/http_stream_factory_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698