OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_simple_server.h" | 5 #include "net/tools/quic/quic_simple_server.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_random.h" | 7 #include "net/quic/crypto/quic_random.h" |
8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
9 #include "net/quic/test_tools/crypto_test_utils.h" | 9 #include "net/quic/test_tools/crypto_test_utils.h" |
10 #include "net/quic/test_tools/mock_quic_dispatcher.h" | 10 #include "net/quic/test_tools/mock_quic_dispatcher.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // TODO(dmz) Remove "Chrome" part of name once net/tools/quic is deleted. | 21 // TODO(dmz) Remove "Chrome" part of name once net/tools/quic is deleted. |
22 class QuicChromeServerDispatchPacketTest : public ::testing::Test { | 22 class QuicChromeServerDispatchPacketTest : public ::testing::Test { |
23 public: | 23 public: |
24 QuicChromeServerDispatchPacketTest() | 24 QuicChromeServerDispatchPacketTest() |
25 : crypto_config_("blah", | 25 : crypto_config_("blah", |
26 QuicRandom::GetInstance(), | 26 QuicRandom::GetInstance(), |
27 CryptoTestUtils::ProofSourceForTesting()), | 27 CryptoTestUtils::ProofSourceForTesting()), |
28 dispatcher_(config_, | 28 dispatcher_(config_, |
29 &crypto_config_, | 29 &crypto_config_, |
30 new tools::QuicDispatcher::DefaultPacketWriterFactory(), | 30 new tools::QuicDispatcher::DefaultPacketWriterFactory(), |
31 new net::test::MockHelper) { | 31 new net::test::MockConnectionHelper) { |
32 dispatcher_.InitializeWithWriter(nullptr); | 32 dispatcher_.InitializeWithWriter(nullptr); |
33 } | 33 } |
34 | 34 |
35 void DispatchPacket(const QuicEncryptedPacket& packet) { | 35 void DispatchPacket(const QuicEncryptedPacket& packet) { |
36 IPEndPoint client_addr, server_addr; | 36 IPEndPoint client_addr, server_addr; |
37 dispatcher_.ProcessPacket(server_addr, client_addr, packet); | 37 dispatcher_.ProcessPacket(server_addr, client_addr, packet); |
38 } | 38 } |
39 | 39 |
40 protected: | 40 protected: |
41 QuicConfig config_; | 41 QuicConfig config_; |
(...skipping 16 matching lines...) Expand all Loading... |
58 QuicEncryptedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), | 58 QuicEncryptedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), |
59 arraysize(valid_packet), false); | 59 arraysize(valid_packet), false); |
60 | 60 |
61 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); | 61 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); |
62 DispatchPacket(encrypted_valid_packet); | 62 DispatchPacket(encrypted_valid_packet); |
63 } | 63 } |
64 | 64 |
65 } // namespace tools | 65 } // namespace tools |
66 } // namespace test | 66 } // namespace test |
67 } // namespace net | 67 } // namespace net |
OLD | NEW |