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

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

Issue 1907773002: Make QuicDispatcher's helper argument be a unique_ptr to make ownership (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119678304
Patch Set: Rebase Created 4 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
« no previous file with comments | « net/tools/quic/quic_simple_server.cc ('k') | net/tools/quic/test_tools/quic_test_server.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 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"
11 #include "net/quic/test_tools/quic_test_utils.h" 11 #include "net/quic/test_tools/quic_test_utils.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 using ::testing::_; 14 using ::testing::_;
15 using net::test::CryptoTestUtils; 15 using net::test::CryptoTestUtils;
16 16
17 namespace net { 17 namespace net {
18 namespace test { 18 namespace test {
19 19
20 // TODO(dmz) Remove "Chrome" part of name once net/tools/quic is deleted. 20 // TODO(dmz) Remove "Chrome" part of name once net/tools/quic is deleted.
21 class QuicChromeServerDispatchPacketTest : public ::testing::Test { 21 class QuicChromeServerDispatchPacketTest : public ::testing::Test {
22 public: 22 public:
23 QuicChromeServerDispatchPacketTest() 23 QuicChromeServerDispatchPacketTest()
24 : crypto_config_("blah", 24 : crypto_config_("blah",
25 QuicRandom::GetInstance(), 25 QuicRandom::GetInstance(),
26 CryptoTestUtils::ProofSourceForTesting()), 26 CryptoTestUtils::ProofSourceForTesting()),
27 dispatcher_(config_, 27 dispatcher_(config_,
28 &crypto_config_, 28 &crypto_config_,
29 new net::test::MockConnectionHelper) { 29 std::unique_ptr<MockConnectionHelper>(new net::test::MockCon nectionHelper)) {
30 dispatcher_.InitializeWithWriter(nullptr); 30 dispatcher_.InitializeWithWriter(nullptr);
31 } 31 }
32 32
33 void DispatchPacket(const QuicReceivedPacket& packet) { 33 void DispatchPacket(const QuicReceivedPacket& packet) {
34 IPEndPoint client_addr, server_addr; 34 IPEndPoint client_addr, server_addr;
35 dispatcher_.ProcessPacket(server_addr, client_addr, packet); 35 dispatcher_.ProcessPacket(server_addr, client_addr, packet);
36 } 36 }
37 37
38 protected: 38 protected:
39 QuicConfig config_; 39 QuicConfig config_;
(...skipping 14 matching lines...) Expand all
54 QuicReceivedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), 54 QuicReceivedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet),
55 arraysize(valid_packet), 55 arraysize(valid_packet),
56 QuicTime::Zero(), false); 56 QuicTime::Zero(), false);
57 57
58 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); 58 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1);
59 DispatchPacket(encrypted_valid_packet); 59 DispatchPacket(encrypted_valid_packet);
60 } 60 }
61 61
62 } // namespace test 62 } // namespace test
63 } // namespace net 63 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server.cc ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698