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

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

Issue 217053010: Revert of Rename PrivateMode enum values: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_session_key.h" 8 #include "net/quic/quic_session_key.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 EXPECT_EQ(state.source_address_token(), other.source_address_token()); 49 EXPECT_EQ(state.source_address_token(), other.source_address_token());
50 EXPECT_EQ(state.certs(), other.certs()); 50 EXPECT_EQ(state.certs(), other.certs());
51 EXPECT_EQ(1u, other.generation_counter()); 51 EXPECT_EQ(1u, other.generation_counter());
52 } 52 }
53 53
54 TEST(QuicCryptoClientConfigTest, InchoateChlo) { 54 TEST(QuicCryptoClientConfigTest, InchoateChlo) {
55 QuicCryptoClientConfig::CachedState state; 55 QuicCryptoClientConfig::CachedState state;
56 QuicCryptoClientConfig config; 56 QuicCryptoClientConfig config;
57 QuicCryptoNegotiatedParameters params; 57 QuicCryptoNegotiatedParameters params;
58 CryptoHandshakeMessage msg; 58 CryptoHandshakeMessage msg;
59 QuicSessionKey server_key("www.google.com", 80, false, PRIVACY_MODE_DISABLED); 59 QuicSessionKey server_key("www.google.com", 80, false, kPrivacyModeDisabled);
60 config.FillInchoateClientHello(server_key, QuicVersionMax(), &state, 60 config.FillInchoateClientHello(server_key, QuicVersionMax(), &state,
61 &params, &msg); 61 &params, &msg);
62 62
63 QuicTag cver; 63 QuicTag cver;
64 EXPECT_EQ(QUIC_NO_ERROR, msg.GetUint32(kVER, &cver)); 64 EXPECT_EQ(QUIC_NO_ERROR, msg.GetUint32(kVER, &cver));
65 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver); 65 EXPECT_EQ(QuicVersionToQuicTag(QuicVersionMax()), cver);
66 } 66 }
67 67
68 TEST(QuicCryptoClientConfigTest, PreferAesGcm) { 68 TEST(QuicCryptoClientConfigTest, PreferAesGcm) {
69 QuicCryptoClientConfig config; 69 QuicCryptoClientConfig config;
(...skipping 25 matching lines...) Expand all
95 QuicCryptoClientConfig config; 95 QuicCryptoClientConfig config;
96 EXPECT_EQ(QUIC_VERSION_NEGOTIATION_MISMATCH, 96 EXPECT_EQ(QUIC_VERSION_NEGOTIATION_MISMATCH,
97 config.ProcessServerHello(msg, 0, supported_versions, 97 config.ProcessServerHello(msg, 0, supported_versions,
98 &cached, &out_params, &error)); 98 &cached, &out_params, &error));
99 EXPECT_EQ("Downgrade attack detected", error); 99 EXPECT_EQ("Downgrade attack detected", error);
100 } 100 }
101 101
102 TEST(QuicCryptoClientConfigTest, InitializeFrom) { 102 TEST(QuicCryptoClientConfigTest, InitializeFrom) {
103 QuicCryptoClientConfig config; 103 QuicCryptoClientConfig config;
104 QuicSessionKey canonical_key1("www.google.com", 80, false, 104 QuicSessionKey canonical_key1("www.google.com", 80, false,
105 PRIVACY_MODE_DISABLED); 105 kPrivacyModeDisabled);
106 QuicCryptoClientConfig::CachedState* state = 106 QuicCryptoClientConfig::CachedState* state =
107 config.LookupOrCreate(canonical_key1); 107 config.LookupOrCreate(canonical_key1);
108 // TODO(rch): Populate other fields of |state|. 108 // TODO(rch): Populate other fields of |state|.
109 state->set_source_address_token("TOKEN"); 109 state->set_source_address_token("TOKEN");
110 state->SetProofValid(); 110 state->SetProofValid();
111 111
112 QuicSessionKey other_key("mail.google.com", 80, false, PRIVACY_MODE_DISABLED); 112 QuicSessionKey other_key("mail.google.com", 80, false, kPrivacyModeDisabled);
113 config.InitializeFrom(other_key, canonical_key1, &config); 113 config.InitializeFrom(other_key, canonical_key1, &config);
114 QuicCryptoClientConfig::CachedState* other = config.LookupOrCreate(other_key); 114 QuicCryptoClientConfig::CachedState* other = config.LookupOrCreate(other_key);
115 115
116 EXPECT_EQ(state->server_config(), other->server_config()); 116 EXPECT_EQ(state->server_config(), other->server_config());
117 EXPECT_EQ(state->source_address_token(), other->source_address_token()); 117 EXPECT_EQ(state->source_address_token(), other->source_address_token());
118 EXPECT_EQ(state->certs(), other->certs()); 118 EXPECT_EQ(state->certs(), other->certs());
119 EXPECT_EQ(1u, other->generation_counter()); 119 EXPECT_EQ(1u, other->generation_counter());
120 } 120 }
121 121
122 } // namespace test 122 } // namespace test
123 } // namespace net 123 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_unittest.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698