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

Unified Diff: net/quic/core/crypto/quic_crypto_client_config_test.cc

Issue 2308043003: Landing Recent QUIC changes until 5:55 PM, Aug 25, 2016 UTC-4 (Closed)
Patch Set: Fixes for various tests Created 4 years, 3 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/core/crypto/quic_crypto_client_config.cc ('k') | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/quic_crypto_client_config_test.cc
diff --git a/net/quic/core/crypto/quic_crypto_client_config_test.cc b/net/quic/core/crypto/quic_crypto_client_config_test.cc
index 7ca3658075444cb64e0eb1210ca00d3c9d096098..c39bd05048a021f5b58215a5effd6cdb8a68e3c7 100644
--- a/net/quic/core/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/core/crypto/quic_crypto_client_config_test.cc
@@ -210,6 +210,32 @@ TEST(QuicCryptoClientConfigTest, InchoateChloSecure) {
EXPECT_FALSE(msg.GetStringPiece(kSCID, &scid));
}
+TEST(QuicCryptoClientConfigTest, InchoateChloSecureWithSCIDNoEXPY) {
+ // Test that a config with no EXPY is still valid when a non-zero
+ // expiry time is passed in.
+ QuicCryptoClientConfig::CachedState state;
+ CryptoHandshakeMessage scfg;
+ scfg.set_tag(kSCFG);
+ scfg.SetStringPiece(kSCID, "12345678");
+ string details;
+ QuicWallTime now = QuicWallTime::FromUNIXSeconds(1);
+ QuicWallTime expiry = QuicWallTime::FromUNIXSeconds(2);
+ state.SetServerConfig(scfg.GetSerialized().AsStringPiece(), now, expiry,
+ &details);
+
+ QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
+ QuicCryptoNegotiatedParameters params;
+ CryptoHandshakeMessage msg;
+ QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
+ MockRandom rand;
+ config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, &rand,
+ /* demand_x509_proof= */ true, &params, &msg);
+
+ StringPiece scid;
+ EXPECT_TRUE(msg.GetStringPiece(kSCID, &scid));
+ EXPECT_EQ("12345678", scid);
+}
+
TEST(QuicCryptoClientConfigTest, InchoateChloSecureWithSCID) {
QuicCryptoClientConfig::CachedState state;
CryptoHandshakeMessage scfg;
@@ -219,6 +245,7 @@ TEST(QuicCryptoClientConfigTest, InchoateChloSecureWithSCID) {
scfg.SetStringPiece(kSCID, "12345678");
string details;
state.SetServerConfig(scfg.GetSerialized().AsStringPiece(),
+ QuicWallTime::FromUNIXSeconds(1),
QuicWallTime::FromUNIXSeconds(0), &details);
QuicCryptoClientConfig config(CryptoTestUtils::ProofVerifierForTesting());
@@ -356,7 +383,8 @@ TEST(QuicCryptoClientConfigTest, ClearCachedStates) {
scfg.SetStringPiece(kSCID, "12345678");
string details;
state->SetServerConfig(scfg.GetSerialized().AsStringPiece(),
- QuicWallTime::FromUNIXSeconds(0), &details);
+ QuicWallTime::FromUNIXSeconds(0),
+ QuicWallTime::FromUNIXSeconds(future), &details);
vector<string> certs(1);
certs[0] = "Hello Cert for " + host;
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.cc ('k') | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698