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 b5a1b5b15b9c06b55796216d5094b2b8212dfc59..0eac60ab22384f8850b99c36eac9d94db9078a97 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,59 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) { |
EXPECT_TRUE(socket_data.at_write_eof()); |
} |
+class ZeroRttDependsOnWhetherSameHostTest : public QuicStreamFactoryTest { |
+ public: |
+ void Run(bool same_host) { |
+ 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", ""); |
+ |
+ std::string origin_host = |
+ same_host ? host_port_pair_.host() : "different.host.example.com"; |
+ QuicStreamRequest request(&factory_); |
+ int rv = |
+ request.Request(host_port_pair_, is_https_, privacy_mode_, origin_host, |
+ "GET", net_log_, callback_.callback()); |
+ if (same_host) { |
+ EXPECT_EQ(OK, rv); |
+ } else { |
+ // If server and origin have different hostnames, handshake confirmation |
+ // should be required, so this 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.at_read_eof()); |
+ EXPECT_TRUE(socket_data.at_write_eof()); |
+ } |
+}; |
+ |
+INSTANTIATE_TEST_CASE_P(Version, |
+ ZeroRttDependsOnWhetherSameHostTest, |
+ ::testing::ValuesIn(GetTestParams())); |
+ |
+TEST_P(ZeroRttDependsOnWhetherSameHostTest, SameHostEnabled) { |
+ Run(true); |
Ryan Hamilton
2015/05/18 14:29:52
How does this test differ from CreateZeroRtt? (I t
Bence
2015/05/18 15:17:55
I agree, it doesn't.
|
+} |
+ |
+TEST_P(ZeroRttDependsOnWhetherSameHostTest, DifferentHostDisabled) { |
+ Run(false); |
Ryan Hamilton
2015/05/18 14:29:52
Just inline the run method.
Bence
2015/05/18 15:17:55
How about removing the CreateZeroRtt test and keep
Ryan Hamilton
2015/05/18 16:21:55
In general, it's preferable to avoid logic in test
Bence
2015/05/18 18:12:02
Fair enough. I sometimes have difficulties findin
|
+} |
+ |
TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) { |
MockRead reads[] = { |
MockRead(ASYNC, OK, 0) // EOF |
@@ -454,11 +490,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 +500,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 +535,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 +580,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 +624,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 +648,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 +693,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 +752,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()); |
@@ -825,24 +811,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()); |
@@ -894,24 +872,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()); |
@@ -967,24 +937,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()); |
@@ -1040,24 +1002,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()); |
@@ -1085,11 +1039,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()); |
@@ -1110,11 +1061,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(); |
@@ -1158,11 +1106,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); |
@@ -1178,13 +1123,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( |
@@ -1210,11 +1151,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()); |
@@ -1232,11 +1170,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()); |
@@ -1254,11 +1189,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())); |
} |
@@ -1321,11 +1253,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()); |
@@ -1345,11 +1274,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()); |
@@ -1384,11 +1310,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()); |
@@ -1409,11 +1332,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()); |
@@ -1448,11 +1368,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()); |
@@ -1473,11 +1390,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()); |
@@ -1512,11 +1426,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()); |
@@ -1537,11 +1448,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()); |
@@ -1651,8 +1559,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)); |
@@ -1686,7 +1595,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. |
@@ -1736,7 +1646,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_); |
@@ -1772,8 +1683,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_); |
@@ -1805,8 +1717,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_); |