| 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 6ba4b566bbf98bb07323805b4af6549b044a74a2..6bb57e8aa529683d3848aa72a85133389cdb349b 100644
|
| --- a/net/quic/quic_stream_factory_test.cc
|
| +++ b/net/quic/quic_stream_factory_test.cc
|
| @@ -265,11 +265,8 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(destination,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(destination, is_https_, privacy_mode_,
|
| + destination.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -345,11 +342,8 @@ TEST_P(QuicStreamFactoryTest, Create) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -363,13 +357,9 @@ TEST_P(QuicStreamFactoryTest, Create) {
|
| // TODO(rtenneti): We should probably have a tests that HTTP and HTTPS result
|
| // in streams on different sessions.
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + EXPECT_EQ(OK, request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
| stream = request2.ReleaseStream(); // Will reset stream 5.
|
| stream.reset(); // Will reset stream 7.
|
|
|
| @@ -392,13 +382,9 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRtt) {
|
| "192.168.0.1", "");
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
|
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
| @@ -423,11 +409,8 @@ 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_,
|
| - "POST",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "POST", net_log_,
|
| callback_.callback()));
|
|
|
| // Confirm the handshake and verify that the stream is created.
|
| @@ -441,6 +424,38 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) {
|
| EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| }
|
|
|
| +TEST_P(QuicStreamFactoryTest, NoZeroRttForDifferentHost) {
|
| + MockRead reads[] = {
|
| + MockRead(ASYNC, OK, 0),
|
| + };
|
| + DeterministicSocketData socket_data(reads, arraysize(reads), nullptr, 0);
|
| + socket_factory_.AddSocketDataProvider(&socket_data);
|
| + socket_data.StopAfter(1);
|
| +
|
| + crypto_client_stream_factory_.set_handshake_mode(
|
| + MockCryptoClientStream::ZERO_RTT);
|
| + host_resolver_.set_synchronous_mode(true);
|
| + host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(),
|
| + "192.168.0.1", "");
|
| +
|
| + QuicStreamRequest request(&factory_);
|
| + int rv = request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + "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.
|
| + EXPECT_EQ(ERR_IO_PENDING, rv);
|
| + // Confirm handshake.
|
| + crypto_client_stream_factory_.last_stream()->SendOnCryptoHandshakeEvent(
|
| + QuicSession::HANDSHAKE_CONFIRMED);
|
| + EXPECT_EQ(OK, callback_.WaitForResult());
|
| +
|
| + scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| + EXPECT_TRUE(stream.get());
|
| + EXPECT_TRUE(socket_data.AllReadDataConsumed());
|
| + EXPECT_TRUE(socket_data.AllWriteDataConsumed());
|
| +}
|
| +
|
| TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
|
| MockRead reads[] = {
|
| MockRead(ASYNC, OK, 0) // EOF
|
| @@ -454,11 +469,8 @@ TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -467,11 +479,8 @@ TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - !is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, !is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| stream = request2.ReleaseStream();
|
| @@ -505,25 +514,17 @@ 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_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -558,25 +559,17 @@ TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
|
| QuicStreamFactoryPeer::DisableConnectionPooling(&factory_);
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -610,25 +603,17 @@ 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_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -642,12 +627,8 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| EXPECT_EQ(OK,
|
| - request3.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback3.callback()));
|
| + request3.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback3.callback()));
|
| scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream();
|
| EXPECT_TRUE(stream3.get());
|
|
|
| @@ -691,24 +672,16 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -758,24 +731,16 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -824,24 +789,16 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithCertMismatch) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -892,24 +849,16 @@ TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -964,24 +913,16 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -1044,24 +985,16 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
|
| QuicStreamRequest request(&factory_);
|
| is_https_ = true;
|
| EXPECT_EQ(OK,
|
| - request.Request(server1,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request.Request(server1, is_https_, privacy_mode_, server1.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream.get());
|
|
|
| TestCompletionCallback callback;
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(OK,
|
| - request2.Request(server2,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - callback_.callback()));
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback_.callback()));
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| EXPECT_TRUE(stream2.get());
|
|
|
| @@ -1089,11 +1022,8 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1114,11 +1044,8 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
|
| // new session is created.
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
|
| @@ -1162,11 +1089,8 @@ 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_,
|
| - "GET",
|
| - net_log_,
|
| + int rv = request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback());
|
| if (i == 0) {
|
| EXPECT_EQ(ERR_IO_PENDING, rv);
|
| @@ -1182,13 +1106,9 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
|
| }
|
|
|
| QuicStreamRequest request(&factory_);
|
| - EXPECT_EQ(OK,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| - CompletionCallback()));
|
| + EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + CompletionCallback()));
|
| scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
|
| EXPECT_TRUE(stream);
|
| EXPECT_EQ(ERR_IO_PENDING, stream->InitializeStream(
|
| @@ -1214,11 +1134,8 @@ TEST_P(QuicStreamFactoryTest, ResolutionErrorInCreate) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(ERR_NAME_NOT_RESOLVED, callback_.WaitForResult());
|
| @@ -1236,11 +1153,8 @@ TEST_P(QuicStreamFactoryTest, ConnectErrorInCreate) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(ERR_ADDRESS_IN_USE, callback_.WaitForResult());
|
| @@ -1258,11 +1172,8 @@ TEST_P(QuicStreamFactoryTest, CancelCreate) {
|
| {
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
| }
|
|
|
| @@ -1325,11 +1236,8 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1349,11 +1257,8 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1388,11 +1293,8 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1413,11 +1315,8 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1452,11 +1351,8 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1477,11 +1373,8 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1516,11 +1409,8 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1541,11 +1431,8 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
|
|
|
| QuicStreamRequest request2(&factory_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request2.Request(host_port_pair_,
|
| - is_https_,
|
| - privacy_mode_,
|
| - "GET",
|
| - net_log_,
|
| + request2.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| callback_.callback()));
|
|
|
| EXPECT_EQ(OK, callback_.WaitForResult());
|
| @@ -1655,8 +1542,9 @@ TEST_P(QuicStreamFactoryTest, RacingConnections) {
|
| QuicStreamRequest request(&factory_);
|
| QuicServerId server_id(host_port_pair_, is_https_, privacy_mode_);
|
| EXPECT_EQ(ERR_IO_PENDING,
|
| - request.Request(host_port_pair_, is_https_, privacy_mode_, "GET",
|
| - net_log_, callback_.callback()));
|
| + request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
| EXPECT_EQ(2u,
|
| QuicStreamFactoryPeer::GetNumberOfActiveJobs(&factory_, server_id));
|
|
|
| @@ -1690,7 +1578,8 @@ TEST_P(QuicStreamFactoryTest, EnableNotLoadFromDiskCache) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| - "GET", net_log_, callback_.callback()));
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
|
|
| // If we are waiting for disk cache, we would have posted a task. Verify that
|
| // the CancelWaitForDataReady task hasn't been posted.
|
| @@ -1740,7 +1629,8 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
|
|
| QuicStreamRequest request(&factory_);
|
| EXPECT_EQ(OK, request.Request(host_port_pair_, is_https_, privacy_mode_,
|
| - "GET", net_log_, callback_.callback()));
|
| + host_port_pair_.host(), "GET", net_log_,
|
| + callback_.callback()));
|
|
|
| QuicClientSession* session = QuicStreamFactoryPeer::GetActiveSession(
|
| &factory_, host_port_pair_, is_https_);
|
| @@ -1776,8 +1666,9 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
|
|
| TestCompletionCallback callback2;
|
| QuicStreamRequest request2(&factory_);
|
| - EXPECT_EQ(OK, request2.Request(server2, is_https_, privacy_mode_, "GET",
|
| - net_log_, callback2.callback()));
|
| + EXPECT_EQ(OK,
|
| + request2.Request(server2, is_https_, privacy_mode_, server2.host(),
|
| + "GET", net_log_, callback2.callback()));
|
| QuicClientSession* session2 =
|
| QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_);
|
|
|
| @@ -1809,8 +1700,9 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
|
|
|
| TestCompletionCallback callback3;
|
| QuicStreamRequest request3(&factory_);
|
| - EXPECT_EQ(OK, request3.Request(server3, is_https_, privacy_mode_, "GET",
|
| - net_log_, callback3.callback()));
|
| + EXPECT_EQ(OK,
|
| + request3.Request(server3, is_https_, privacy_mode_, server3.host(),
|
| + "GET", net_log_, callback3.callback()));
|
| QuicClientSession* session3 =
|
| QuicStreamFactoryPeer::GetActiveSession(&factory_, server3, is_https_);
|
|
|
|
|