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

Side by Side Diff: net/tools/quic/quic_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_server.cc ('k') | net/tools/quic/quic_simple_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_server.h" 5 #include "net/tools/quic/quic_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 11 matching lines...) Expand all
22 22
23 class QuicServerDispatchPacketTest : public ::testing::Test { 23 class QuicServerDispatchPacketTest : public ::testing::Test {
24 public: 24 public:
25 QuicServerDispatchPacketTest() 25 QuicServerDispatchPacketTest()
26 : crypto_config_("blah", 26 : crypto_config_("blah",
27 QuicRandom::GetInstance(), 27 QuicRandom::GetInstance(),
28 CryptoTestUtils::ProofSourceForTesting()), 28 CryptoTestUtils::ProofSourceForTesting()),
29 dispatcher_( 29 dispatcher_(
30 config_, 30 config_,
31 &crypto_config_, 31 &crypto_config_,
32 new QuicEpollConnectionHelper(&eps_, QuicAllocator::BUFFER_POOL)) { 32 std::unique_ptr<QuicEpollConnectionHelper>(
33 new QuicEpollConnectionHelper(&eps_,
34 QuicAllocator::BUFFER_POOL))) {
33 dispatcher_.InitializeWithWriter(new QuicDefaultPacketWriter(1234)); 35 dispatcher_.InitializeWithWriter(new QuicDefaultPacketWriter(1234));
34 } 36 }
35 37
36 void DispatchPacket(const QuicReceivedPacket& packet) { 38 void DispatchPacket(const QuicReceivedPacket& packet) {
37 IPEndPoint client_addr, server_addr; 39 IPEndPoint client_addr, server_addr;
38 dispatcher_.ProcessPacket(server_addr, client_addr, packet); 40 dispatcher_.ProcessPacket(server_addr, client_addr, packet);
39 } 41 }
40 42
41 protected: 43 protected:
42 QuicConfig config_; 44 QuicConfig config_;
(...skipping 21 matching lines...) Expand all
64 arraysize(valid_packet), 66 arraysize(valid_packet),
65 QuicTime::Zero(), false); 67 QuicTime::Zero(), false);
66 68
67 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); 69 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1);
68 DispatchPacket(encrypted_valid_packet); 70 DispatchPacket(encrypted_valid_packet);
69 } 71 }
70 72
71 } // namespace 73 } // namespace
72 } // namespace test 74 } // namespace test
73 } // namespace net 75 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server.cc ('k') | net/tools/quic/quic_simple_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698