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

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

Issue 1411063004: Remove insecure QUIC support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic_client_session.h" 5 #include "net/tools/quic/quic_client_session.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h"
(...skipping 19 matching lines...) Expand all
30 using testing::AnyNumber; 30 using testing::AnyNumber;
31 using testing::Invoke; 31 using testing::Invoke;
32 using testing::Truly; 32 using testing::Truly;
33 using testing::_; 33 using testing::_;
34 34
35 namespace net { 35 namespace net {
36 namespace tools { 36 namespace tools {
37 namespace test { 37 namespace test {
38 namespace { 38 namespace {
39 39
40 const char kServerHostname[] = "www.example.org"; 40 const char kServerHostname[] = "test.example.com";
41 const uint16 kPort = 80; 41 const uint16 kPort = 80;
42 42
43 class ToolsQuicClientSessionTest 43 class ToolsQuicClientSessionTest
44 : public ::testing::TestWithParam<QuicVersion> { 44 : public ::testing::TestWithParam<QuicVersion> {
45 protected: 45 protected:
46 ToolsQuicClientSessionTest() 46 ToolsQuicClientSessionTest()
47 : connection_(new PacketSavingConnection(&helper_, 47 : crypto_config_(CryptoTestUtils::ProofVerifierForTesting()),
48 connection_(new PacketSavingConnection(&helper_,
48 Perspective::IS_CLIENT, 49 Perspective::IS_CLIENT,
49 SupportedVersions(GetParam()))) { 50 SupportedVersions(GetParam()))),
50 session_.reset(new QuicClientSession( 51 session_(new QuicClientSession(
51 DefaultQuicConfig(), connection_, 52 DefaultQuicConfig(), connection_,
52 QuicServerId(kServerHostname, kPort, false, PRIVACY_MODE_DISABLED), 53 QuicServerId(kServerHostname, kPort, PRIVACY_MODE_DISABLED),
53 &crypto_config_)); 54 &crypto_config_)) {
54 session_->Initialize(); 55 session_->Initialize();
55 // Advance the time, because timers do not like uninitialized times. 56 // Advance the time, because timers do not like uninitialized times.
56 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); 57 connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
57 } 58 }
58 59
59 void CompleteCryptoHandshake() { 60 void CompleteCryptoHandshake() {
60 session_->CryptoConnect(); 61 session_->CryptoConnect();
61 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, 62 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_,
62 session_->GetCryptoStream()); 63 session_->GetCryptoStream());
63 } 64 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 PACKET_6BYTE_PACKET_NUMBER, nullptr)); 182 PACKET_6BYTE_PACKET_NUMBER, nullptr));
182 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); 183 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1);
183 session_->connection()->ProcessUdpPacket(client_address, server_address, 184 session_->connection()->ProcessUdpPacket(client_address, server_address,
184 *packet); 185 *packet);
185 } 186 }
186 187
187 } // namespace 188 } // namespace
188 } // namespace test 189 } // namespace test
189 } // namespace tools 190 } // namespace tools
190 } // namespace net 191 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698