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

Side by Side Diff: net/tools/quic/stateless_rejector_test.cc

Issue 2517603003: Moves QuicTag typedefs, and QuicTag utility methods to quic_tag.{h,cc}. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/tools/quic/stateless_rejector.h" 5 #include "net/tools/quic/stateless_rejector.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 GetParam().flags == ENABLED || GetParam().flags == STATELESS_DISABLED; 96 GetParam().flags == ENABLED || GetParam().flags == STATELESS_DISABLED;
97 97
98 // Add a new primary config. 98 // Add a new primary config.
99 std::unique_ptr<CryptoHandshakeMessage> msg(config_.AddDefaultConfig( 99 std::unique_ptr<CryptoHandshakeMessage> msg(config_.AddDefaultConfig(
100 QuicRandom::GetInstance(), &clock_, config_options_)); 100 QuicRandom::GetInstance(), &clock_, config_options_));
101 101
102 // Save the server config. 102 // Save the server config.
103 scid_hex_ = "#" + QuicUtils::HexEncode(config_peer_.GetPrimaryConfig()->id); 103 scid_hex_ = "#" + QuicUtils::HexEncode(config_peer_.GetPrimaryConfig()->id);
104 104
105 // Encode the QUIC version. 105 // Encode the QUIC version.
106 ver_hex_ = QuicUtils::TagToString(QuicVersionToQuicTag(GetParam().version)); 106 ver_hex_ = QuicTagToString(QuicVersionToQuicTag(GetParam().version));
107 107
108 // Generate a public value. 108 // Generate a public value.
109 char public_value[32]; 109 char public_value[32];
110 memset(public_value, 42, sizeof(public_value)); 110 memset(public_value, 42, sizeof(public_value));
111 pubs_hex_ = "#" + QuicUtils::HexEncode(public_value, sizeof(public_value)); 111 pubs_hex_ = "#" + QuicUtils::HexEncode(public_value, sizeof(public_value));
112 112
113 // Generate a client nonce. 113 // Generate a client nonce.
114 string nonce; 114 string nonce;
115 CryptoUtils::GenerateNonce( 115 CryptoUtils::GenerateNonce(
116 clock_.WallNow(), QuicRandom::GetInstance(), 116 clock_.WallNow(), QuicRandom::GetInstance(),
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state()); 283 ASSERT_EQ(StatelessRejector::UNKNOWN, rejector_->state());
284 StatelessRejector::Process(std::move(rejector_), 284 StatelessRejector::Process(std::move(rejector_),
285 base::MakeUnique<ProcessDoneCallback>(this)); 285 base::MakeUnique<ProcessDoneCallback>(this));
286 286
287 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state()); 287 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_->state());
288 } 288 }
289 289
290 } // namespace 290 } // namespace
291 } // namespace test 291 } // namespace test
292 } // namespace net 292 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698