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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 2113343002: QUIC - added force_hol_blocking field trial param to enable forced HOL blocking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126418608
Patch Set: review feedback round #1 Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/quic_test_packet_maker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory_test.cc
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index ef056be66ec7a0d81f4edd1dc298276f71a7f718..cb159de83acc88e2867e211c23b54ea6e8dc44e6 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -320,7 +320,8 @@ class QuicStreamFactoryTestBase {
disable_quic_on_timeout_with_open_streams_(false),
idle_connection_timeout_seconds_(kIdleConnectionTimeoutSeconds),
migrate_sessions_on_network_change_(false),
- migrate_sessions_early_(false) {
+ migrate_sessions_early_(false),
+ force_hol_blocking_(false) {
clock_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
}
@@ -352,7 +353,7 @@ class QuicStreamFactoryTestBase {
close_sessions_on_ip_change_,
disable_quic_on_timeout_with_open_streams_,
idle_connection_timeout_seconds_, migrate_sessions_on_network_change_,
- migrate_sessions_early_, QuicTagVector(),
+ migrate_sessions_early_, force_hol_blocking_, QuicTagVector(),
/*enable_token_binding*/ false));
factory_->set_require_confirmation(false);
EXPECT_FALSE(factory_->has_quic_server_info_factory());
@@ -545,6 +546,7 @@ class QuicStreamFactoryTestBase {
int idle_connection_timeout_seconds_;
bool migrate_sessions_on_network_change_;
bool migrate_sessions_early_;
+ bool force_hol_blocking_;
};
class QuicStreamFactoryTest : public QuicStreamFactoryTestBase,
@@ -4394,6 +4396,33 @@ TEST_P(QuicStreamFactoryTest, PoolByOrigin) {
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
}
+TEST_P(QuicStreamFactoryTest, ForceHolBlockingEnabled) {
+ force_hol_blocking_ = true;
+ Initialize();
+
+ ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
+ crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
+
+ MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
+ SequencedSocketData socket_data(reads, arraysize(reads), nullptr, 0);
+ socket_factory_.AddSocketDataProvider(&socket_data);
+
+ QuicStreamRequest request(factory_.get());
+ EXPECT_EQ(ERR_IO_PENDING,
+ request.Request(host_port_pair_, privacy_mode_,
+ /*cert_verify_flags=*/0, url_, "GET", net_log_,
+ callback_.callback()));
+
+ EXPECT_EQ(OK, callback_.WaitForResult());
+
+ QuicChromiumClientSession* session = GetActiveSession(host_port_pair_);
+ if (session->connection()->version() > QUIC_VERSION_35) {
+ EXPECT_TRUE(session->force_hol_blocking());
+ } else {
+ EXPECT_FALSE(session->force_hol_blocking());
+ }
+}
+
class QuicStreamFactoryWithDestinationTest
: public QuicStreamFactoryTestBase,
public ::testing::TestWithParam<PoolingTestParams> {
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/quic_test_packet_maker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698