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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 1692253004: QUIC - chromium server push support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial for-review version Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 abe601201bf52ec7a82494ffa59f019e17c4977b..9bdb52a9385b4a80f1d90f295d6013e210f9742e 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -23,6 +23,7 @@
#include "net/quic/crypto/quic_decrypter.h"
#include "net/quic/crypto/quic_encrypter.h"
#include "net/quic/crypto/quic_server_info.h"
+#include "net/quic/quic_client_promised_info.h"
#include "net/quic/quic_http_stream.h"
#include "net/quic/quic_http_utils.h"
#include "net/quic/quic_server_id.h"
@@ -298,7 +299,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(destination, privacy_mode_,
/*cert_verify_flags=*/0, destination.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -441,7 +442,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -457,7 +458,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
EXPECT_EQ(OK,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
stream = request2.ReleaseStream(); // Will reset stream 5.
stream.reset(); // Will reset stream 7.
@@ -483,7 +484,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRtt) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -511,7 +512,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "POST", net_log_, callback_.callback()));
+ "POST", "", net_log_, callback_.callback()));
// Confirm the handshake and verify that the stream is created.
crypto_client_stream_factory_.last_stream()->SendOnCryptoHandshakeEvent(
@@ -540,9 +541,9 @@ TEST_P(QuicStreamFactoryTest, NoZeroRttForDifferentHost) {
"192.168.0.1", "");
QuicStreamRequest request(factory_.get());
- int rv =
- request.Request(host_port_pair_, privacy_mode_, /*cert_verify_flags=*/0,
- kServer2HostName, "GET", net_log_, callback_.callback());
+ int rv = request.Request(host_port_pair_, privacy_mode_,
+ /*cert_verify_flags=*/0, kServer2HostName, "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);
@@ -570,7 +571,7 @@ TEST_P(QuicStreamFactoryTest, GoAway) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -606,7 +607,7 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -614,7 +615,7 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback.callback()));
+ "", net_log_, callback.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -648,7 +649,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -656,7 +657,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback.callback()));
+ "", net_log_, callback.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -691,7 +692,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -699,7 +700,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback.callback()));
+ "", net_log_, callback.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -714,7 +715,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream();
EXPECT_TRUE(stream3.get());
@@ -746,7 +747,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
/*cert_verify_flags=*/0, server1.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -754,7 +755,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -789,7 +790,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
/*cert_verify_flags=*/0, server1.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -797,7 +798,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -842,13 +843,13 @@ class QuicAlternativeServiceCertificateValidationPooling
QuicStreamRequest request1(factory_.get());
EXPECT_EQ(OK, request1.Request(alternative, privacy_mode_,
/*cert_verify_flags=*/0, alternative.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream1 = request1.ReleaseStream();
EXPECT_TRUE(stream1.get());
QuicStreamRequest request2(factory_.get());
int rv = request2.Request(alternative, privacy_mode_,
- /*cert_verify_flags=*/0, origin_host, "GET",
+ /*cert_verify_flags=*/0, origin_host, "GET", "",
net_log_, callback_.callback());
if (valid) {
// Alternative service of origin to |alternative| should pool to session
@@ -906,7 +907,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
/*cert_verify_flags=*/0, server1.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -914,7 +915,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -955,7 +956,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
/*cert_verify_flags=*/0, server1.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -963,7 +964,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -1009,7 +1010,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
/*cert_verify_flags=*/0, server1.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1017,7 +1018,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback_.callback()));
+ "", net_log_, callback_.callback()));
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -1046,7 +1047,7 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -1069,7 +1070,7 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -1118,7 +1119,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
QuicStreamRequest request(factory_.get());
int rv = request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback());
+ "GET", "", net_log_, callback_.callback());
if (i == 0) {
EXPECT_EQ(ERR_IO_PENDING, rv);
EXPECT_EQ(OK, callback_.WaitForResult());
@@ -1135,7 +1136,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, CompletionCallback()));
+ "GET", "", net_log_, CompletionCallback()));
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream);
EXPECT_EQ(ERR_IO_PENDING,
@@ -1173,7 +1174,7 @@ TEST_P(QuicStreamFactoryTest, ResolutionErrorInCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(ERR_NAME_NOT_RESOLVED, callback_.WaitForResult());
@@ -1192,7 +1193,7 @@ TEST_P(QuicStreamFactoryTest, ConnectErrorInCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(ERR_ADDRESS_IN_USE, callback_.WaitForResult());
@@ -1210,7 +1211,7 @@ TEST_P(QuicStreamFactoryTest, CancelCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
}
base::RunLoop().RunUntilIdle();
@@ -1281,7 +1282,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -1301,7 +1302,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
stream = request2.ReleaseStream();
@@ -1337,7 +1338,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -1358,7 +1359,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
stream = request2.ReleaseStream();
@@ -1391,7 +1392,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeSoonToDisconnect) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1456,7 +1457,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeSoonToDisconnect) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -1506,7 +1507,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeDisconnected) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1567,7 +1568,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeDisconnected) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -1608,7 +1609,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeSoonToDisconnectNoNetworks) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1662,7 +1663,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeDisconnectedNoNetworks) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1711,7 +1712,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeSoonToDisconnectNoNewNetwork) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1763,7 +1764,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeDisconnectedNoNewNetwork) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1807,7 +1808,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeSoonToDisconnectNoOpenStreams) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1845,7 +1846,7 @@ TEST_P(QuicStreamFactoryTest, OnNetworkChangeDisconnectedNoOpenStreams) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1889,7 +1890,7 @@ TEST_P(QuicStreamFactoryTest, MigrateSessionEarly) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -1957,7 +1958,7 @@ TEST_P(QuicStreamFactoryTest, MigrateSessionEarly) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
EXPECT_TRUE(stream2.get());
@@ -2012,7 +2013,7 @@ TEST_P(QuicStreamFactoryTest, MigrateSessionEarlyNoNewNetwork) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
EXPECT_TRUE(stream.get());
@@ -2070,7 +2071,7 @@ TEST_P(QuicStreamFactoryTest, OnSSLConfigChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -2090,7 +2091,7 @@ TEST_P(QuicStreamFactoryTest, OnSSLConfigChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
stream = request2.ReleaseStream();
@@ -2125,7 +2126,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -2146,7 +2147,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
stream = request2.ReleaseStream();
@@ -2181,7 +2182,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
@@ -2202,7 +2203,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(OK, callback_.WaitForResult());
stream = request2.ReleaseStream();
@@ -2326,7 +2327,7 @@ TEST_P(QuicStreamFactoryTest, RacingConnections) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
EXPECT_EQ(2u, QuicStreamFactoryPeer::GetNumberOfActiveJobs(factory_.get(),
server_id));
@@ -2361,7 +2362,7 @@ TEST_P(QuicStreamFactoryTest, EnableNotLoadFromDiskCache) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "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.
@@ -2419,7 +2420,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -2457,7 +2458,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -2489,7 +2490,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
/*cert_verify_flags=*/0, server3.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
QuicChromiumClientSession* session3 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server3);
@@ -2498,7 +2499,7 @@ TEST_P(QuicStreamFactoryTest, BadPacketLoss) {
QuicStreamRequest request4(factory_.get());
EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
/*cert_verify_flags=*/0, server4.host(), "GET",
- net_log_, callback4.callback()));
+ "", net_log_, callback4.callback()));
QuicChromiumClientSession* session4 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server4);
@@ -2579,7 +2580,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfTwo) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -2603,7 +2604,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfTwo) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -2664,7 +2665,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfTwo) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -2695,7 +2696,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfTwo) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -2762,7 +2763,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -2785,7 +2786,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -2806,7 +2807,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfThree) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
/*cert_verify_flags=*/0, server3.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
QuicChromiumClientSession* session3 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server3);
@@ -2880,7 +2881,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -2911,7 +2912,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -2933,7 +2934,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfThree) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
/*cert_verify_flags=*/0, server3.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
QuicChromiumClientSession* session3 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server3);
@@ -2991,7 +2992,7 @@ TEST_P(QuicStreamFactoryTest, DisableQuicWhenTimeoutsWithOpenStreams) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -3070,7 +3071,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -3093,7 +3094,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -3112,7 +3113,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
/*cert_verify_flags=*/0, server3.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
QuicChromiumClientSession* session3 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server3);
@@ -3133,7 +3134,7 @@ TEST_P(QuicStreamFactoryTest, PublicResetPostHandshakeTwoOfFour) {
QuicStreamRequest request4(factory_.get());
EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
/*cert_verify_flags=*/0, server4.host(), "GET",
- net_log_, callback4.callback()));
+ "", net_log_, callback4.callback()));
QuicChromiumClientSession* session4 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server4);
@@ -3214,7 +3215,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
QuicChromiumClientSession* session =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
@@ -3244,7 +3245,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
QuicStreamRequest request2(factory_.get());
EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
/*cert_verify_flags=*/0, server2.host(), "GET",
- net_log_, callback2.callback()));
+ "", net_log_, callback2.callback()));
QuicChromiumClientSession* session2 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server2);
@@ -3263,7 +3264,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
QuicStreamRequest request3(factory_.get());
EXPECT_EQ(OK, request3.Request(server3, privacy_mode_,
/*cert_verify_flags=*/0, server3.host(), "GET",
- net_log_, callback3.callback()));
+ "", net_log_, callback3.callback()));
QuicChromiumClientSession* session3 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server3);
@@ -3285,7 +3286,7 @@ TEST_P(QuicStreamFactoryTest, TimeoutsWithOpenStreamsTwoOfFour) {
QuicStreamRequest request4(factory_.get());
EXPECT_EQ(OK, request4.Request(server4, privacy_mode_,
/*cert_verify_flags=*/0, server4.host(), "GET",
- net_log_, callback4.callback()));
+ "", net_log_, callback4.callback()));
QuicChromiumClientSession* session4 =
QuicStreamFactoryPeer::GetActiveSession(factory_.get(), server4);
@@ -3342,7 +3343,7 @@ TEST_P(QuicStreamFactoryTest, EnableDelayTcpRace) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "POST", net_log_, callback_.callback()));
+ "POST", "", net_log_, callback_.callback()));
// If we don't delay TCP connection, then time delay should be 0.
EXPECT_FALSE(factory_->delay_tcp_race());
@@ -3494,7 +3495,7 @@ TEST_P(QuicStreamFactoryTest, YieldAfterPackets) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
// Call run_loop so that QuicChromiumPacketReader::OnReadComplete() gets
// called.
@@ -3543,7 +3544,7 @@ TEST_P(QuicStreamFactoryTest, YieldAfterDuration) {
QuicStreamRequest request(factory_.get());
EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
/*cert_verify_flags=*/0, host_port_pair_.host(),
- "GET", net_log_, callback_.callback()));
+ "GET", "", net_log_, callback_.callback()));
// Call run_loop so that QuicChromiumPacketReader::OnReadComplete() gets
// called.
@@ -3561,5 +3562,110 @@ TEST_P(QuicStreamFactoryTest, YieldAfterDuration) {
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
}
+TEST_P(QuicStreamFactoryTest, ServerPushSessionAffinity) {
+ Initialize();
+ ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
+ crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
+
+ MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
+ SequencedSocketData socket_data(reads, arraysize(reads), nullptr, 0);
+ socket_factory_.AddSocketDataProvider(&socket_data);
+
+ QuicStreamRequest request(factory_.get());
+ EXPECT_EQ(ERR_IO_PENDING,
+ request.Request(host_port_pair_, privacy_mode_,
+ /*cert_verify_flags=*/0, host_port_pair_.host(),
+ "GET", "", net_log_, callback_.callback()));
+
+ EXPECT_EQ(OK, callback_.WaitForResult());
+ scoped_ptr<QuicHttpStream> stream = request.ReleaseStream();
+ EXPECT_TRUE(stream.get());
+
+ EXPECT_EQ(0, QuicStreamFactoryPeer::GetNumPushStreamsCreated(factory_.get()));
+
+ std::string url = "https://www.example.org/";
+
+ QuicChromiumClientSession* session =
+ QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
+
+ QuicClientPromisedInfo promised(session, kServerDataStreamId1, url);
+ (*QuicStreamFactoryPeer::GetPushPromiseIndex(factory_.get())
+ ->promised_by_url())[url] = &promised;
+
+ QuicStreamRequest request2(factory_.get());
+ EXPECT_EQ(OK,
+ request2.Request(host_port_pair_, privacy_mode_,
+ /*cert_verify_flags=*/0, host_port_pair_.host(),
+ "GET", url, net_log_, callback_.callback()));
+
+ EXPECT_EQ(1, QuicStreamFactoryPeer::GetNumPushStreamsCreated(factory_.get()));
+}
+
+TEST_P(QuicStreamFactoryTest, ServerPushPrivacyModeMismatch) {
+ Initialize();
+ ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
+ crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
+ crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
+
+ MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
+
+ scoped_ptr<QuicEncryptedPacket> client_rst(maker_.MakeRstPacket(
+ 1, true, kServerDataStreamId1, QUIC_STREAM_CANCELLED));
+ MockWrite writes[] = {
+ MockWrite(SYNCHRONOUS, client_rst->data(), client_rst->length(), 1),
+ };
+
+ SequencedSocketData socket_data1(reads, arraysize(reads), writes,
+ arraysize(writes));
+ SequencedSocketData socket_data2(reads, arraysize(reads), nullptr, 0);
+
+ socket_factory_.AddSocketDataProvider(&socket_data1);
+ socket_factory_.AddSocketDataProvider(&socket_data2);
+
+ QuicStreamRequest request(factory_.get());
+ EXPECT_EQ(ERR_IO_PENDING,
+ request.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> stream = request.ReleaseStream();
+ EXPECT_TRUE(stream.get());
+
+ EXPECT_EQ(0, QuicStreamFactoryPeer::GetNumPushStreamsCreated(factory_.get()));
+
+ std::string url = "https://www.example.org/";
+ QuicChromiumClientSession* session =
+ QuicStreamFactoryPeer::GetActiveSession(factory_.get(), host_port_pair_);
+
+ QuicClientPromisedInfo promised(session, kServerDataStreamId1, url);
+
+ QuicClientPushPromiseIndex* index =
+ QuicStreamFactoryPeer::GetPushPromiseIndex(factory_.get());
+
+ (*index->promised_by_url())[url] = &promised;
+ EXPECT_EQ(index->GetPromised(url), &promised);
+
+ // Doing the request should not use the push stream, but rather
+ // cancel it because the privacy modes do not match.
+ QuicStreamRequest request2(factory_.get());
+ EXPECT_EQ(ERR_IO_PENDING,
+ request2.Request(host_port_pair_, PRIVACY_MODE_ENABLED,
+ /*cert_verify_flags=*/0, host_port_pair_.host(),
+ "GET", url, net_log_, callback_.callback()));
+
+ EXPECT_EQ(0, QuicStreamFactoryPeer::GetNumPushStreamsCreated(factory_.get()));
+ EXPECT_EQ(index->GetPromised(url), nullptr);
+
+ EXPECT_EQ(OK, callback_.WaitForResult());
+ scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream();
+ EXPECT_TRUE(stream2.get());
+
+ EXPECT_TRUE(socket_data1.AllReadDataConsumed());
+ EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
+ EXPECT_TRUE(socket_data2.AllReadDataConsumed());
+ EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
+}
+
} // namespace test
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698