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

Side by Side Diff: net/quic/chromium/quic_network_transaction_unittest.cc

Issue 2306173003: Add a new QuicFlagSaver class for saving/restoring the values of QUIC flags in tests. (Closed)
Patch Set: Better Created 4 years, 3 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
« no previous file with comments | « no previous file | net/quic/core/congestion_control/general_loss_algorithm_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 EXPECT_TRUE(session_->proxy_service()->proxy_retry_info().empty()); 658 EXPECT_TRUE(session_->proxy_service()->proxy_retry_info().empty());
659 659
660 // The alternative proxy server should no longer be in use. 660 // The alternative proxy server should no longer be in use.
661 EXPECT_FALSE(test_proxy_delegate.alternative_proxy_server().is_valid()); 661 EXPECT_FALSE(test_proxy_delegate.alternative_proxy_server().is_valid());
662 662
663 // Verify that the second request completes successfully, and the 663 // Verify that the second request completes successfully, and the
664 // alternative proxy server job is not started. 664 // alternative proxy server job is not started.
665 SendRequestAndExpectHttpResponseFromProxy("hello from http", true, 443); 665 SendRequestAndExpectHttpResponseFromProxy("hello from http", true, 443);
666 } 666 }
667 667
668 QuicFlagSaver flags_; // Save/restore all QUIC flag values.
668 MockClock* clock_; // Owned by QuicStreamFactory after CreateSession. 669 MockClock* clock_; // Owned by QuicStreamFactory after CreateSession.
669 QuicTestPacketMaker client_maker_; 670 QuicTestPacketMaker client_maker_;
670 QuicTestPacketMaker server_maker_; 671 QuicTestPacketMaker server_maker_;
671 std::unique_ptr<HttpNetworkSession> session_; 672 std::unique_ptr<HttpNetworkSession> session_;
672 MockClientSocketFactory socket_factory_; 673 MockClientSocketFactory socket_factory_;
673 ProofVerifyDetailsChromium verify_details_; 674 ProofVerifyDetailsChromium verify_details_;
674 MockCryptoClientStreamFactory crypto_client_stream_factory_; 675 MockCryptoClientStreamFactory crypto_client_stream_factory_;
675 MockHostResolver host_resolver_; 676 MockHostResolver host_resolver_;
676 MockCertVerifier cert_verifier_; 677 MockCertVerifier cert_verifier_;
677 TransportSecurityState transport_security_state_; 678 TransportSecurityState transport_security_state_;
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 EXPECT_LT(0u, entries.size()); 2553 EXPECT_LT(0u, entries.size());
2553 2554
2554 // Check that we logged a QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM 2555 // Check that we logged a QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM
2555 int pos = ExpectLogContainsSomewhere( 2556 int pos = ExpectLogContainsSomewhere(
2556 entries, 0, NetLog::TYPE_QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM, 2557 entries, 0, NetLog::TYPE_QUIC_HTTP_STREAM_ADOPTED_PUSH_STREAM,
2557 NetLog::PHASE_NONE); 2558 NetLog::PHASE_NONE);
2558 EXPECT_LT(0, pos); 2559 EXPECT_LT(0, pos);
2559 } 2560 }
2560 2561
2561 TEST_P(QuicNetworkTransactionTest, QuicForceHolBlocking) { 2562 TEST_P(QuicNetworkTransactionTest, QuicForceHolBlocking) {
2562 ValueRestore<bool> old_v35_flag(&FLAGS_quic_enable_version_35,
2563 FLAGS_quic_enable_version_35);
2564 ValueRestore<bool> old_v36_flag(&FLAGS_quic_enable_version_36,
2565 FLAGS_quic_enable_version_36);
2566 FLAGS_quic_enable_version_35 = true; 2563 FLAGS_quic_enable_version_35 = true;
2567 FLAGS_quic_enable_version_36 = true; 2564 FLAGS_quic_enable_version_36 = true;
2568 params_.quic_force_hol_blocking = true; 2565 params_.quic_force_hol_blocking = true;
2569 params_.origins_to_force_quic_on.insert( 2566 params_.origins_to_force_quic_on.insert(
2570 HostPortPair::FromString("mail.example.org:443")); 2567 HostPortPair::FromString("mail.example.org:443"));
2571 2568
2572 MockQuicData mock_quic_data; 2569 MockQuicData mock_quic_data;
2573 2570
2574 QuicStreamOffset offset = 0; 2571 QuicStreamOffset offset = 0;
2575 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket( 2572 mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3027 AddHangingSocketData(); 3024 AddHangingSocketData();
3028 3025
3029 SendRequestAndExpectQuicResponse(origin1_); 3026 SendRequestAndExpectQuicResponse(origin1_);
3030 SendRequestAndExpectQuicResponse(origin2_); 3027 SendRequestAndExpectQuicResponse(origin2_);
3031 3028
3032 EXPECT_TRUE(AllDataConsumed()); 3029 EXPECT_TRUE(AllDataConsumed());
3033 } 3030 }
3034 3031
3035 } // namespace test 3032 } // namespace test
3036 } // namespace net 3033 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/core/congestion_control/general_loss_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698