| 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 4209bc47ecb8444228d1a7de7b004e160c5fc331..a8fabd98fcaaf95817ebc52cbcd34e48bf5a82fc 100644
|
| --- a/net/quic/quic_stream_factory_test.cc
|
| +++ b/net/quic/quic_stream_factory_test.cc
|
| @@ -84,17 +84,17 @@ class QuicStreamFactoryPeer {
|
| }
|
|
|
| static bool HasActiveSession(QuicStreamFactory* factory,
|
| - const HostPortPair& host_port_pair,
|
| - bool is_https) {
|
| - QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED);
|
| + const HostPortPair& host_port_pair) {
|
| + QuicServerId server_id(host_port_pair, /*is_https=*/true,
|
| + PRIVACY_MODE_DISABLED);
|
| return factory->HasActiveSession(server_id);
|
| }
|
|
|
| static QuicChromiumClientSession* GetActiveSession(
|
| QuicStreamFactory* factory,
|
| - const HostPortPair& host_port_pair,
|
| - bool is_https) {
|
| - QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED);
|
| + const HostPortPair& host_port_pair) {
|
| + QuicServerId server_id(host_port_pair, /*is_https=*/true,
|
| + PRIVACY_MODE_DISABLED);
|
| DCHECK(factory->HasActiveSession(server_id));
|
| return factory->active_sessions_[server_id];
|
| }
|
| @@ -295,7 +295,6 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
| /*delay_tcp_race=*/false,
|
| QuicTagVector()),
|
| host_port_pair_(kDefaultServerHostName, kDefaultServerPort),
|
| - is_https_(false),
|
| privacy_mode_(PRIVACY_MODE_DISABLED) {
|
| factory_.set_require_confirmation(false);
|
| clock_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
|
| @@ -304,15 +303,13 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
| }
|
|
|
| bool HasActiveSession(const HostPortPair& host_port_pair) {
|
| - return QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair,
|
| - /*is_https_=*/false);
|
| + return QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair);
|
| }
|
|
|
| scoped_ptr<QuicHttpStream> CreateFromSession(
|
| const HostPortPair& host_port_pair) {
|
| QuicChromiumClientSession* session =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair,
|
| - /*is_https=*/false);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair);
|
| return QuicStreamFactoryPeer::CreateFromSession(&factory_, session);
|
| }
|
|
|
| @@ -340,7 +337,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(destination, is_https_, privacy_mode_,
|
| + request.Request(destination, privacy_mode_,
|
| /*cert_verify_flags=*/0, destination.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -350,8 +347,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
| stream.reset();
|
|
|
| QuicChromiumClientSession* session =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, destination,
|
| - is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, destination);
|
|
|
| if (socket_count + 1 != socket_factory_.udp_client_sockets().size()) {
|
| EXPECT_TRUE(false);
|
| @@ -411,7 +407,6 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
| TransportSecurityState transport_security_state_;
|
| QuicStreamFactory factory_;
|
| HostPortPair host_port_pair_;
|
| - bool is_https_;
|
| PrivacyMode privacy_mode_;
|
| BoundNetLog net_log_;
|
| TestCompletionCallback callback_;
|
| @@ -431,7 +426,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -447,7 +442,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
|
| // in streams on different sessions.
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| stream = request2.ReleaseStream(); // Will reset stream 5.
|
| @@ -472,7 +467,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRtt) {
|
| "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -499,7 +494,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) {
|
| QuicStreamRequest request(&factory_);
|
| // Posts require handshake confirmation, so this will return asynchronously.
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "POST", net_log_, callback_.callback()));
|
|
|
| @@ -530,7 +525,7 @@ TEST_P(QuicStreamFactoryTest, NoZeroRttForDifferentHost) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| int rv = request.Request(
|
| - host_port_pair_, is_https_, privacy_mode_, /*cert_verify_flags=*/0,
|
| + host_port_pair_, privacy_mode_, /*cert_verify_flags=*/0,
|
| "different.host.example.com", "GET", net_log_, callback_.callback());
|
| // If server and origin have different hostnames, then handshake confirmation
|
| // should be required, so Request will return asynchronously.
|
| @@ -546,48 +541,6 @@ TEST_P(QuicStreamFactoryTest, NoZeroRttForDifferentHost) {
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| }
|
|
|
| -TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
|
| - MockRead reads[] = {
|
| - MockRead(ASYNC, OK, 0) // EOF
|
| - };
|
| - DeterministicSocketData socket_data1(reads, arraysize(reads), nullptr, 0);
|
| - DeterministicSocketData socket_data2(reads, arraysize(reads), nullptr, 0);
|
| - socket_factory_.AddSocketDataProvider(&socket_data1);
|
| - socket_factory_.AddSocketDataProvider(&socket_data2);
|
| - socket_data1.StopAfter(1);
|
| - socket_data2.StopAfter(1);
|
| -
|
| - QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| - /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| - "GET", net_log_, callback_.callback()));
|
| -
|
| - EXPECT_EQ(OK, callback_.WaitForResult());
|
| - scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| - EXPECT_TRUE(stream.get());
|
| -
|
| - QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, !is_https_, privacy_mode_,
|
| - /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| - "GET", net_log_, callback_.callback()));
|
| - EXPECT_EQ(OK, callback_.WaitForResult());
|
| - stream = request2.ReleaseStream();
|
| - EXPECT_TRUE(stream.get());
|
| - stream.reset();
|
| -
|
| - EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, !is_https_));
|
| -
|
| - EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| - EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| - EXPECT_TRUE(socket_data2.AllReadDataConsumed());
|
| - EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
|
| -}
|
| -
|
| TEST_P(QuicStreamFactoryTest, GoAway) {
|
| MockRead reads[] = {
|
| MockRead(ASYNC, OK, 0) // EOF
|
| @@ -598,7 +551,7 @@ TEST_P(QuicStreamFactoryTest, GoAway) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -606,13 +559,13 @@ TEST_P(QuicStreamFactoryTest, GoAway) {
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| session->OnGoAway(QuicGoAwayFrame());
|
|
|
| - EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| + EXPECT_FALSE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
|
|
| EXPECT_TRUE(socket_data.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| @@ -634,7 +587,7 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
|
| "mail.google.com", "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -642,16 +595,14 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_EQ(
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_));
|
| + EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| @@ -679,7 +630,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
|
| QuicStreamFactoryPeer::DisableConnectionPooling(&factory_);
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -687,16 +638,14 @@ TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_NE(
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_));
|
| + EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| @@ -723,7 +672,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
|
| "mail.google.com", "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -731,29 +680,27 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - factory_.OnSessionGoingAway(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| - EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| - EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, server2, is_https_));
|
| + factory_.OnSessionGoingAway(
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_));
|
| + EXPECT_FALSE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
| + EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(&factory_, server2));
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback3.callback()));
|
| scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream();
|
| EXPECT_TRUE(stream3.get());
|
|
|
| - EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| @@ -780,8 +727,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
|
| host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request.Request(server1, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
|
| /*cert_verify_flags=*/0, server1.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -789,16 +735,14 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server1, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession(&factory_, server1),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| @@ -829,8 +773,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
|
| QuicStreamFactoryPeer::DisableConnectionPooling(&factory_);
|
|
|
| QuicStreamRequest request(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request.Request(server1, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
|
| /*cert_verify_flags=*/0, server1.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -838,16 +781,14 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server1, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(&factory_, server1),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| @@ -888,15 +829,14 @@ class QuicAlternativeServiceCertificateValidationPooling
|
|
|
| // Open first stream to alternative.
|
| QuicStreamRequest request1(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request1.Request(alternative, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request1.Request(alternative, privacy_mode_,
|
| /*cert_verify_flags=*/0, alternative.host(),
|
| "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream1 = request1.ReleaseStream();
|
| EXPECT_TRUE(stream1.get());
|
|
|
| QuicStreamRequest request2(&factory_);
|
| - int rv = request2.Request(alternative, is_https_, privacy_mode_,
|
| + int rv = request2.Request(alternative, privacy_mode_,
|
| /*cert_verify_flags=*/0, origin_host, "GET",
|
| net_log_, callback_.callback());
|
| if (valid) {
|
| @@ -953,8 +893,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
|
| host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request.Request(server1, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
|
| /*cert_verify_flags=*/0, server1.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -962,16 +901,14 @@ TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server1, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession(&factory_, server1),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| @@ -1008,8 +945,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
|
| QuicStreamFactoryPeer::DisableConnectionPooling(&factory_);
|
|
|
| QuicStreamRequest request(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request.Request(server1, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
|
| /*cert_verify_flags=*/0, server1.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -1017,16 +953,14 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server1, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(&factory_, server1),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| @@ -1068,8 +1002,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
|
| host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - is_https_ = true;
|
| - EXPECT_EQ(OK, request.Request(server1, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
|
| /*cert_verify_flags=*/0, server1.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -1077,16 +1010,14 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server1, is_https_),
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, server2, is_https_));
|
| + EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession(&factory_, server1),
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2));
|
|
|
| EXPECT_TRUE(socket_data1.AllReadDataConsumed());
|
| EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
|
| @@ -1107,7 +1038,7 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1117,31 +1048,29 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
|
|
|
| // Mark the session as going away. Ensure that while it is still alive
|
| // that it is no longer active.
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
| factory_.OnSessionGoingAway(session);
|
| EXPECT_EQ(true, QuicStreamFactoryPeer::IsLiveSession(&factory_, session));
|
| - EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| + EXPECT_FALSE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
| EXPECT_FALSE(HasActiveSession(host_port_pair_));
|
|
|
| // Create a new request for the same destination and verify that a
|
| // new session is created.
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| - EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(&factory_,
|
| - host_port_pair_,
|
| - is_https_));
|
| - EXPECT_NE(session,
|
| - QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| + EXPECT_TRUE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
| + EXPECT_NE(session, QuicStreamFactoryPeer::GetActiveSession(&factory_,
|
| + host_port_pair_));
|
| EXPECT_EQ(true, QuicStreamFactoryPeer::IsLiveSession(&factory_, session));
|
|
|
| stream2.reset();
|
| @@ -1174,7 +1103,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
|
| // kDefaultMaxStreamsPerConnection / 2.
|
| for (size_t i = 0; i < kDefaultMaxStreamsPerConnection / 2; i++) {
|
| QuicStreamRequest request(&factory_);
|
| - int rv = request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + int rv = request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback());
|
| if (i == 0) {
|
| @@ -1191,7 +1120,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
|
| }
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, CompletionCallback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -1219,7 +1148,7 @@ TEST_P(QuicStreamFactoryTest, ResolutionErrorInCreate) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1238,7 +1167,7 @@ TEST_P(QuicStreamFactoryTest, ConnectErrorInCreate) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1257,7 +1186,7 @@ TEST_P(QuicStreamFactoryTest, CancelCreate) {
|
| {
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| }
|
| @@ -1320,7 +1249,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1341,7 +1270,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1377,7 +1306,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1399,7 +1328,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1435,7 +1364,7 @@ TEST_P(QuicStreamFactoryTest, OnSSLConfigChanged) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1455,7 +1384,7 @@ TEST_P(QuicStreamFactoryTest, OnSSLConfigChanged) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1491,7 +1420,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1513,7 +1442,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1549,7 +1478,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1571,7 +1500,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request2.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1599,7 +1528,7 @@ TEST_P(QuicStreamFactoryTest, SharedCryptoConfig) {
|
| HostPortPair host_port_pair1(r1_host_name, 80);
|
| QuicCryptoClientConfig* crypto_config =
|
| QuicStreamFactoryPeer::GetCryptoConfig(&factory_);
|
| - QuicServerId server_id1(host_port_pair1, is_https_, privacy_mode_);
|
| + QuicServerId server_id1(host_port_pair1, /*is_https=*/true, privacy_mode_);
|
| QuicCryptoClientConfig::CachedState* cached1 =
|
| crypto_config->LookupOrCreate(server_id1);
|
| EXPECT_FALSE(cached1->proof_valid());
|
| @@ -1611,7 +1540,7 @@ TEST_P(QuicStreamFactoryTest, SharedCryptoConfig) {
|
| cached1->SetProofValid();
|
|
|
| HostPortPair host_port_pair2(r2_host_name, 80);
|
| - QuicServerId server_id2(host_port_pair2, is_https_, privacy_mode_);
|
| + QuicServerId server_id2(host_port_pair2, /*is_https=*/true, privacy_mode_);
|
| QuicCryptoClientConfig::CachedState* cached2 =
|
| crypto_config->LookupOrCreate(server_id2);
|
| EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token());
|
| @@ -1633,7 +1562,7 @@ TEST_P(QuicStreamFactoryTest, CryptoConfigWhenProofIsInvalid) {
|
| HostPortPair host_port_pair1(r3_host_name, 80);
|
| QuicCryptoClientConfig* crypto_config =
|
| QuicStreamFactoryPeer::GetCryptoConfig(&factory_);
|
| - QuicServerId server_id1(host_port_pair1, is_https_, privacy_mode_);
|
| + QuicServerId server_id1(host_port_pair1, /*is_https=*/true, privacy_mode_);
|
| QuicCryptoClientConfig::CachedState* cached1 =
|
| crypto_config->LookupOrCreate(server_id1);
|
| EXPECT_FALSE(cached1->proof_valid());
|
| @@ -1645,7 +1574,7 @@ TEST_P(QuicStreamFactoryTest, CryptoConfigWhenProofIsInvalid) {
|
| cached1->SetProofInvalid();
|
|
|
| HostPortPair host_port_pair2(r4_host_name, 80);
|
| - QuicServerId server_id2(host_port_pair2, is_https_, privacy_mode_);
|
| + QuicServerId server_id2(host_port_pair2, /*is_https=*/true, privacy_mode_);
|
| QuicCryptoClientConfig::CachedState* cached2 =
|
| crypto_config->LookupOrCreate(server_id2);
|
| EXPECT_NE(cached1->source_address_token(), cached2->source_address_token());
|
| @@ -1680,9 +1609,9 @@ TEST_P(QuicStreamFactoryTest, RacingConnections) {
|
| "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - QuicServerId server_id(host_port_pair_, is_https_, privacy_mode_);
|
| + QuicServerId server_id(host_port_pair_, /*is_https=*/true, privacy_mode_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
| EXPECT_EQ(2u,
|
| @@ -1717,7 +1646,7 @@ TEST_P(QuicStreamFactoryTest, EnableNotLoadFromDiskCache) {
|
| "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -1774,12 +1703,12 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| host_resolver_.rules()->AddIPLiteralRule(server4.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| DVLOG(1) << "Create 1st session and test packet loss";
|
|
|
| @@ -1787,8 +1716,8 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| EXPECT_FALSE(
|
| factory_.OnHandshakeConfirmed(session, /*packet_loss_rate=*/0.9f));
|
| EXPECT_TRUE(session->connection()->connected());
|
| - EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| + EXPECT_TRUE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
| EXPECT_FALSE(
|
| QuicStreamFactoryPeer::IsQuicDisabled(&factory_, host_port_pair_.port()));
|
| EXPECT_EQ(0, QuicStreamFactoryPeer::GetNumberOfLossyConnections(
|
| @@ -1803,8 +1732,8 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| EXPECT_TRUE(session->connection()->connected());
|
| EXPECT_FALSE(
|
| QuicStreamFactoryPeer::IsQuicDisabled(&factory_, host_port_pair_.port()));
|
| - EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(
|
| - &factory_, host_port_pair_, is_https_));
|
| + EXPECT_TRUE(
|
| + QuicStreamFactoryPeer::HasActiveSession(&factory_, host_port_pair_));
|
|
|
| // Test N-in-a-row high packet loss connections.
|
|
|
| @@ -1812,11 +1741,11 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
|
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| // If there is no packet loss during handshake confirmation, number of lossy
|
| // connections for the port should be 0.
|
| @@ -1838,27 +1767,26 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| EXPECT_TRUE(session2->connection()->connected());
|
| EXPECT_FALSE(
|
| QuicStreamFactoryPeer::IsQuicDisabled(&factory_, server2.port()));
|
| - EXPECT_TRUE(
|
| - QuicStreamFactoryPeer::HasActiveSession(&factory_, server2, is_https_));
|
| + EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(&factory_, server2));
|
|
|
| DVLOG(1) << "Create 3rd session which also has packet loss";
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
|
| /*cert_verify_flags=*/0, server3.host(), "GET",
|
| net_log_, callback3.callback()));
|
| QuicChromiumClientSession* session3 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server3);
|
|
|
| DVLOG(1) << "Create 4th session with packet loss and test IsQuicDisabled()";
|
| TestCompletionCallback callback4;
|
| QuicStreamRequest request4(&factory_);
|
| - EXPECT_EQ(OK, request4.Request(server4, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
|
| /*cert_verify_flags=*/0, server4.host(), "GET",
|
| net_log_, callback4.callback()));
|
| QuicChromiumClientSession* session4 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server4, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server4);
|
|
|
| // Set packet_loss_rate to higher value than packet_loss_threshold 2nd time in
|
| // a row and that should close the session and disable QUIC.
|
| @@ -1868,8 +1796,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| &factory_, server3.port()));
|
| EXPECT_FALSE(session3->connection()->connected());
|
| EXPECT_TRUE(QuicStreamFactoryPeer::IsQuicDisabled(&factory_, server3.port()));
|
| - EXPECT_FALSE(
|
| - QuicStreamFactoryPeer::HasActiveSession(&factory_, server3, is_https_));
|
| + EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(&factory_, server3));
|
| EXPECT_FALSE(HasActiveSession(server3));
|
|
|
| // Set packet_loss_rate to higher value than packet_loss_threshold 3rd time in
|
| @@ -1880,8 +1807,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
| &factory_, server4.port()));
|
| EXPECT_FALSE(session4->connection()->connected());
|
| EXPECT_TRUE(QuicStreamFactoryPeer::IsQuicDisabled(&factory_, server4.port()));
|
| - EXPECT_FALSE(
|
| - QuicStreamFactoryPeer::HasActiveSession(&factory_, server4, is_https_));
|
| + EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession(&factory_, server4));
|
| EXPECT_FALSE(HasActiveSession(server4));
|
|
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| @@ -1933,12 +1859,12 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfTwo) {
|
| host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| DVLOG(1) << "Created 1st session. Now trigger public reset post handshake";
|
| session->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| @@ -1956,11 +1882,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfTwo) {
|
| DVLOG(1) << "Create 2nd session and trigger public reset post handshake";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| session2->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2016,12 +1942,12 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfTwo) {
|
| host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
| @@ -2045,11 +1971,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfTwo) {
|
| DVLOG(1) << "Create 2nd session and timeout with open stream";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
| @@ -2111,12 +2037,12 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
|
|
|
| // Test first and third out of three public reset post handshakes.
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| DVLOG(1) << "Created 1st session. Now trigger public reset post handshake";
|
| session->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| @@ -2133,11 +2059,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
|
| DVLOG(1) << "Create 2nd session without disable trigger";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| session2->connection()->CloseConnection(QUIC_NO_ERROR, false);
|
| // Need to spin the loop now to ensure that
|
| @@ -2153,11 +2079,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
|
| << " will disable QUIC";
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
|
| /*cert_verify_flags=*/0, server3.host(), "GET",
|
| net_log_, callback3.callback()));
|
| QuicChromiumClientSession* session3 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server3);
|
|
|
| session3->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2226,12 +2152,12 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
|
|
|
| // Test first and third out of three timeouts with open streams.
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
| @@ -2255,11 +2181,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
|
| DVLOG(1) << "Create 2nd session without timeout";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| session2->connection()->CloseConnection(QUIC_NO_ERROR, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2275,11 +2201,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
|
| /*cert_verify_flags=*/0, server3.host(), "GET",
|
| net_log_, callback3.callback()));
|
| QuicChromiumClientSession* session3 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server3);
|
|
|
| scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream();
|
| EXPECT_TRUE(stream3.get());
|
| @@ -2350,12 +2276,12 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
|
|
|
| // Test first and fourth out of four public reset post handshakes.
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| DVLOG(1) << "Created 1st session. Now trigger public reset post handshake";
|
| session->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| @@ -2372,11 +2298,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
|
| DVLOG(1) << "Create 2nd and 3rd sessions without disable trigger";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| session2->connection()->CloseConnection(QUIC_NO_ERROR, false);
|
| // Need to spin the loop now to ensure that
|
| @@ -2390,11 +2316,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
|
| /*cert_verify_flags=*/0, server3.host(), "GET",
|
| net_log_, callback3.callback()));
|
| QuicChromiumClientSession* session3 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server3);
|
|
|
| session3->connection()->CloseConnection(QUIC_NO_ERROR, false);
|
| // Need to spin the loop now to ensure that
|
| @@ -2410,11 +2336,11 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
|
| << " will not disable QUIC";
|
| TestCompletionCallback callback4;
|
| QuicStreamRequest request4(&factory_);
|
| - EXPECT_EQ(OK, request4.Request(server4, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
|
| /*cert_verify_flags=*/0, server4.host(), "GET",
|
| net_log_, callback4.callback()));
|
| QuicChromiumClientSession* session4 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server4, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server4);
|
|
|
| session4->connection()->CloseConnection(QUIC_PUBLIC_RESET, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2490,12 +2416,12 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
|
|
|
| // Test first and fourth out of three timeouts with open streams.
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| - QuicChromiumClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| - &factory_, host_port_pair_, is_https_);
|
| + QuicChromiumClientSession* session =
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, host_port_pair_);
|
|
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
| @@ -2518,11 +2444,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
|
| DVLOG(1) << "Create 2nd and 3rd sessions without timeout";
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
|
| /*cert_verify_flags=*/0, server2.host(), "GET",
|
| net_log_, callback2.callback()));
|
| QuicChromiumClientSession* session2 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server2);
|
|
|
| session2->connection()->CloseConnection(QUIC_NO_ERROR, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2535,11 +2461,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
|
| /*cert_verify_flags=*/0, server3.host(), "GET",
|
| net_log_, callback3.callback()));
|
| QuicChromiumClientSession* session3 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server3);
|
|
|
| session3->connection()->CloseConnection(QUIC_NO_ERROR, true);
|
| // Need to spin the loop now to ensure that
|
| @@ -2555,11 +2481,11 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
|
|
|
| TestCompletionCallback callback4;
|
| QuicStreamRequest request4(&factory_);
|
| - EXPECT_EQ(OK, request4.Request(server4, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
|
| /*cert_verify_flags=*/0, server4.host(), "GET",
|
| net_log_, callback4.callback()));
|
| QuicChromiumClientSession* session4 =
|
| - QuicStreamFactoryPeer::GetActiveSession(&factory_, server4, is_https_);
|
| + QuicStreamFactoryPeer::GetActiveSession(&factory_, server4);
|
|
|
| scoped_ptr<QuicHttpStream> stream4 = request4.ReleaseStream();
|
| EXPECT_TRUE(stream4.get());
|
| @@ -2626,7 +2552,7 @@ TEST_P(QuicStreamFactoryTest, EnableDelayTcpRace) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "POST", net_log_, callback_.callback()));
|
|
|
| @@ -2707,7 +2633,7 @@ TEST_P(QuicStreamFactoryTest, YieldAfterPackets) {
|
| SpdySessionTestTaskObserver observer("quic_packet_reader.cc", "StartReading");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
| @@ -2752,7 +2678,7 @@ TEST_P(QuicStreamFactoryTest, YieldAfterDuration) {
|
| SpdySessionTestTaskObserver observer("quic_packet_reader.cc", "StartReading");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
|
| /*cert_verify_flags=*/0, host_port_pair_.host(),
|
| "GET", net_log_, callback_.callback()));
|
|
|
|
|