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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 185773006: Add PrivacyMode support to the QuicStreamFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory_test.cc
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 3ff203cbc11193e5e6b4d192a8e878dd0a4e64bb..780c5cb8e4bf00b6c02b5fae686617f11ccce4e7 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -48,7 +48,7 @@ class QuicStreamFactoryPeer {
static bool HasActiveSession(QuicStreamFactory* factory,
const HostPortPair& host_port_pair,
bool is_https) {
- QuicSessionKey server_key(host_port_pair, is_https);
+ QuicSessionKey server_key(host_port_pair, is_https, kPrivacyModeDisabled);
return factory->HasActiveSession(server_key);
}
@@ -56,7 +56,7 @@ class QuicStreamFactoryPeer {
QuicStreamFactory* factory,
const HostPortPair& host_port_pair,
bool is_https) {
- QuicSessionKey server_key(host_port_pair, is_https);
+ QuicSessionKey server_key(host_port_pair, is_https, kPrivacyModeDisabled);
DCHECK(factory->HasActiveSession(server_key));
return factory->active_sessions_[server_key];
}
@@ -66,7 +66,7 @@ class QuicStreamFactoryPeer {
const HostPortPair& host_port_pair,
bool is_https,
const BoundNetLog& net_log) {
- QuicSessionKey server_key(host_port_pair, is_https);
+ QuicSessionKey server_key(host_port_pair, is_https, kPrivacyModeDisabled);
return factory->CreateIfSessionExists(server_key, net_log);
}
@@ -96,7 +96,8 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> {
&random_generator_, clock_, kDefaultMaxPacketSize,
SupportedVersions(GetParam()), true, true),
host_port_pair_(kDefaultServerHostName, kDefaultServerPort),
- is_https_(false) {
+ is_https_(false),
+ privacy_mode_(kPrivacyModeDisabled) {
factory_.set_require_confirmation(false);
}
@@ -133,6 +134,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(destination,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -181,6 +183,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> {
QuicStreamFactory factory_;
HostPortPair host_port_pair_;
bool is_https_;
+ PrivacyMode privacy_mode_;
BoundNetLog net_log_;
TestCompletionCallback callback_;
};
@@ -204,6 +207,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -222,6 +226,7 @@ TEST_P(QuicStreamFactoryTest, Create) {
EXPECT_EQ(OK,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -250,6 +255,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRtt) {
EXPECT_EQ(OK,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -279,6 +285,7 @@ TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"POST",
net_log_,
callback_.callback()));
@@ -309,6 +316,7 @@ TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -321,6 +329,7 @@ TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
!is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -359,6 +368,7 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
EXPECT_EQ(OK,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -370,6 +380,7 @@ TEST_P(QuicStreamFactoryTest, Pooling) {
EXPECT_EQ(OK,
request2.Request(server2,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback.callback()));
@@ -407,6 +418,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
EXPECT_EQ(OK,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -418,6 +430,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
EXPECT_EQ(OK,
request2.Request(server2,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback.callback()));
@@ -436,6 +449,7 @@ TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
EXPECT_EQ(OK,
request3.Request(server2,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback3.callback()));
@@ -483,6 +497,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
EXPECT_EQ(OK,
request.Request(server1,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -494,6 +509,7 @@ TEST_P(QuicStreamFactoryTest, HttpsPooling) {
EXPECT_EQ(OK,
request2.Request(server2,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -546,6 +562,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithCertMismatch) {
EXPECT_EQ(OK,
request.Request(server1,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -557,6 +574,7 @@ TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithCertMismatch) {
EXPECT_EQ(OK,
request2.Request(server2,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -589,6 +607,7 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -613,6 +632,7 @@ TEST_P(QuicStreamFactoryTest, Goaway) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -660,6 +680,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
QuicStreamRequest request(&factory_);
int rv = request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback());
@@ -680,6 +701,7 @@ TEST_P(QuicStreamFactoryTest, MaxOpenStream) {
EXPECT_EQ(OK,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
CompletionCallback()));
@@ -710,6 +732,7 @@ TEST_P(QuicStreamFactoryTest, ResolutionErrorInCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -731,6 +754,7 @@ TEST_P(QuicStreamFactoryTest, ConnectErrorInCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -752,6 +776,7 @@ TEST_P(QuicStreamFactoryTest, CancelCreate) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -819,6 +844,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -842,6 +868,7 @@ TEST_P(QuicStreamFactoryTest, CloseAllSessions) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -881,6 +908,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -905,6 +933,7 @@ TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -944,6 +973,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -968,6 +998,7 @@ TEST_P(QuicStreamFactoryTest, OnCertAdded) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -1007,6 +1038,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -1031,6 +1063,7 @@ TEST_P(QuicStreamFactoryTest, OnCACertChanged) {
EXPECT_EQ(ERR_IO_PENDING,
request2.Request(host_port_pair_,
is_https_,
+ privacy_mode_,
"GET",
net_log_,
callback_.callback()));
@@ -1059,7 +1092,7 @@ TEST_P(QuicStreamFactoryTest, SharedCryptoConfig) {
HostPortPair host_port_pair1(r1_host_name, 80);
QuicCryptoClientConfig* crypto_config =
QuicStreamFactoryPeer::GetCryptoConfig(&factory_);
- QuicSessionKey server_key1(host_port_pair1, is_https_);
+ QuicSessionKey server_key1(host_port_pair1, is_https_, privacy_mode_);
QuicCryptoClientConfig::CachedState* cached1 =
crypto_config->LookupOrCreate(server_key1);
EXPECT_FALSE(cached1->proof_valid());
@@ -1071,7 +1104,7 @@ TEST_P(QuicStreamFactoryTest, SharedCryptoConfig) {
cached1->SetProofValid();
HostPortPair host_port_pair2(r2_host_name, 80);
- QuicSessionKey server_key2(host_port_pair2, is_https_);
+ QuicSessionKey server_key2(host_port_pair2, is_https_, privacy_mode_);
QuicCryptoClientConfig::CachedState* cached2 =
crypto_config->LookupOrCreate(server_key2);
EXPECT_EQ(cached1->source_address_token(), cached2->source_address_token());
@@ -1093,7 +1126,7 @@ TEST_P(QuicStreamFactoryTest, CryptoConfigWhenProofIsInvalid) {
HostPortPair host_port_pair1(r3_host_name, 80);
QuicCryptoClientConfig* crypto_config =
QuicStreamFactoryPeer::GetCryptoConfig(&factory_);
- QuicSessionKey server_key1(host_port_pair1, is_https_);
+ QuicSessionKey server_key1(host_port_pair1, is_https_, privacy_mode_);
QuicCryptoClientConfig::CachedState* cached1 =
crypto_config->LookupOrCreate(server_key1);
EXPECT_FALSE(cached1->proof_valid());
@@ -1105,7 +1138,7 @@ TEST_P(QuicStreamFactoryTest, CryptoConfigWhenProofIsInvalid) {
cached1->SetProofInvalid();
HostPortPair host_port_pair2(r4_host_name, 80);
- QuicSessionKey server_key2(host_port_pair2, is_https_);
+ QuicSessionKey server_key2(host_port_pair2, is_https_, privacy_mode_);
QuicCryptoClientConfig::CachedState* cached2 =
crypto_config->LookupOrCreate(server_key2);
EXPECT_NE(cached1->source_address_token(), cached2->source_address_token());
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698