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

Side by Side Diff: net/quic/crypto/quic_crypto_client_config_test.cc

Issue 648933003: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with TOT Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/crypto/quic_crypto_client_config.h" 5 #include "net/quic/crypto/quic_crypto_client_config.h"
6 6
7 #include "net/quic/crypto/proof_verifier.h" 7 #include "net/quic/crypto/proof_verifier.h"
8 #include "net/quic/quic_server_id.h" 8 #include "net/quic/quic_server_id.h"
9 #include "net/quic/test_tools/mock_random.h" 9 #include "net/quic/test_tools/mock_random.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, 74 config.FillInchoateClientHello(server_id, QuicVersionMax(), &state,
75 &params, &msg); 75 &params, &msg);
76 76
77 QuicTag cver; 77 QuicTag cver;
78 EXPECT_EQ(QUIC_NO_ERROR, msg.GetUint32(kVER, &cver)); 78 EXPECT_EQ(QUIC_NO_ERROR, msg.GetUint32(kVER, &cver));
79 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver); 79 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver);
80 } 80 }
81 81
82 TEST(QuicCryptoClientConfigTest, PreferAesGcm) { 82 TEST(QuicCryptoClientConfigTest, PreferAesGcm) {
83 QuicCryptoClientConfig config; 83 QuicCryptoClientConfig config;
84 config.SetDefaults();
85 if (config.aead.size() > 1) 84 if (config.aead.size() > 1)
86 EXPECT_NE(kAESG, config.aead[0]); 85 EXPECT_NE(kAESG, config.aead[0]);
87 config.PreferAesGcm(); 86 config.PreferAesGcm();
88 EXPECT_EQ(kAESG, config.aead[0]); 87 EXPECT_EQ(kAESG, config.aead[0]);
89 } 88 }
90 89
91 TEST(QuicCryptoClientConfigTest, InchoateChloSecure) { 90 TEST(QuicCryptoClientConfigTest, InchoateChloSecure) {
92 QuicCryptoClientConfig::CachedState state; 91 QuicCryptoClientConfig::CachedState state;
93 QuicCryptoClientConfig config; 92 QuicCryptoClientConfig config;
94 QuicCryptoNegotiatedParameters params; 93 QuicCryptoNegotiatedParameters params;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 EXPECT_EQ(state, cleared_cache); 261 EXPECT_EQ(state, cleared_cache);
263 EXPECT_FALSE(cleared_cache->proof_valid()); 262 EXPECT_FALSE(cleared_cache->proof_valid());
264 EXPECT_TRUE(cleared_cache->server_config().empty()); 263 EXPECT_TRUE(cleared_cache->server_config().empty());
265 EXPECT_TRUE(cleared_cache->certs().empty()); 264 EXPECT_TRUE(cleared_cache->certs().empty());
266 EXPECT_TRUE(cleared_cache->signature().empty()); 265 EXPECT_TRUE(cleared_cache->signature().empty());
267 EXPECT_EQ(2u, cleared_cache->generation_counter()); 266 EXPECT_EQ(2u, cleared_cache->generation_counter());
268 } 267 }
269 268
270 } // namespace test 269 } // namespace test
271 } // namespace net 270 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698