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

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

Issue 1433433003: Rename MockHelper to the more descriptive (and more consistent with other Mock classes) MockConnect… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106414015
Patch Set: Created 5 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/quic/test_tools/quic_test_utils.cc ('k') | net/tools/quic/quic_dispatcher_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 (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"
11 #include "net/quic/quic_flags.h" 11 #include "net/quic/quic_flags.h"
12 #include "net/quic/test_tools/crypto_test_utils.h" 12 #include "net/quic/test_tools/crypto_test_utils.h"
13 #include "net/quic/test_tools/quic_spdy_session_peer.h" 13 #include "net/quic/test_tools/quic_spdy_session_peer.h"
14 #include "net/quic/test_tools/quic_test_utils.h" 14 #include "net/quic/test_tools/quic_test_utils.h"
15 #include "net/tools/quic/quic_spdy_client_stream.h" 15 #include "net/tools/quic/quic_spdy_client_stream.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 using net::test::ConstructEncryptedPacket; 18 using net::test::ConstructEncryptedPacket;
19 using net::test::ConstructMisFramedEncryptedPacket; 19 using net::test::ConstructMisFramedEncryptedPacket;
20 using net::test::CryptoTestUtils; 20 using net::test::CryptoTestUtils;
21 using net::test::DefaultQuicConfig; 21 using net::test::DefaultQuicConfig;
22 using net::test::MockConnection; 22 using net::test::MockConnection;
23 using net::test::MockHelper; 23 using net::test::MockConnectionHelper;
24 using net::test::PacketSavingConnection; 24 using net::test::PacketSavingConnection;
25 using net::test::QuicSpdySessionPeer; 25 using net::test::QuicSpdySessionPeer;
26 using net::test::SupportedVersions; 26 using net::test::SupportedVersions;
27 using net::test::TestPeerIPAddress; 27 using net::test::TestPeerIPAddress;
28 using net::test::ValueRestore; 28 using net::test::ValueRestore;
29 using net::test::kTestPort; 29 using net::test::kTestPort;
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::_;
(...skipping 25 matching lines...) Expand all
59 } 59 }
60 60
61 void CompleteCryptoHandshake() { 61 void CompleteCryptoHandshake() {
62 session_->CryptoConnect(); 62 session_->CryptoConnect();
63 QuicCryptoClientStream* stream = 63 QuicCryptoClientStream* stream =
64 static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream()); 64 static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream());
65 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, stream); 65 CryptoTestUtils::HandshakeWithFakeServer(&helper_, connection_, stream);
66 } 66 }
67 67
68 QuicCryptoClientConfig crypto_config_; 68 QuicCryptoClientConfig crypto_config_;
69 MockHelper helper_; 69 MockConnectionHelper helper_;
70 PacketSavingConnection* connection_; 70 PacketSavingConnection* connection_;
71 scoped_ptr<QuicClientSession> session_; 71 scoped_ptr<QuicClientSession> session_;
72 }; 72 };
73 73
74 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest, 74 INSTANTIATE_TEST_CASE_P(Tests, ToolsQuicClientSessionTest,
75 ::testing::ValuesIn(QuicSupportedVersions())); 75 ::testing::ValuesIn(QuicSupportedVersions()));
76 76
77 TEST_P(ToolsQuicClientSessionTest, CryptoConnect) { 77 TEST_P(ToolsQuicClientSessionTest, CryptoConnect) {
78 CompleteCryptoHandshake(); 78 CompleteCryptoHandshake();
79 } 79 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 PACKET_6BYTE_PACKET_NUMBER, nullptr)); 217 PACKET_6BYTE_PACKET_NUMBER, nullptr));
218 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1); 218 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(_, _)).Times(1);
219 session_->connection()->ProcessUdpPacket(client_address, server_address, 219 session_->connection()->ProcessUdpPacket(client_address, server_address,
220 *packet); 220 *packet);
221 } 221 }
222 222
223 } // namespace 223 } // namespace
224 } // namespace test 224 } // namespace test
225 } // namespace tools 225 } // namespace tools
226 } // namespace net 226 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698