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

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

Issue 182523002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed rch's comments in Patch set 1 of CL 181463007 Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_server_session.cc ('k') | net/tools/quic/quic_spdy_server_stream.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/tools/quic/test_tools/mock_quic_dispatcher.h" 9 #include "net/tools/quic/test_tools/mock_quic_dispatcher.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 21 matching lines...) Expand all
32 32
33 protected: 33 protected:
34 QuicConfig config_; 34 QuicConfig config_;
35 QuicCryptoServerConfig crypto_config_; 35 QuicCryptoServerConfig crypto_config_;
36 EpollServer eps_; 36 EpollServer eps_;
37 MockQuicDispatcher dispatcher_; 37 MockQuicDispatcher dispatcher_;
38 }; 38 };
39 39
40 TEST_F(QuicServerDispatchPacketTest, DispatchPacket) { 40 TEST_F(QuicServerDispatchPacketTest, DispatchPacket) {
41 unsigned char valid_packet[] = { 41 unsigned char valid_packet[] = {
42 // public flags (8 byte guid) 42 // public flags (8 byte connection_id)
43 0x3C, 43 0x3C,
44 // guid 44 // connection_id
45 0x10, 0x32, 0x54, 0x76, 45 0x10, 0x32, 0x54, 0x76,
46 0x98, 0xBA, 0xDC, 0xFE, 46 0x98, 0xBA, 0xDC, 0xFE,
47 // packet sequence number 47 // packet sequence number
48 0xBC, 0x9A, 0x78, 0x56, 48 0xBC, 0x9A, 0x78, 0x56,
49 0x34, 0x12, 49 0x34, 0x12,
50 // private flags 50 // private flags
51 0x00 }; 51 0x00 };
52 QuicEncryptedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), 52 QuicEncryptedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet),
53 arraysize(valid_packet), false); 53 arraysize(valid_packet), false);
54 54
55 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); 55 EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1);
56 DispatchPacket(encrypted_valid_packet); 56 DispatchPacket(encrypted_valid_packet);
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 } // namespace test 60 } // namespace test
61 } // namespace tools 61 } // namespace tools
62 } // namespace net 62 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_session.cc ('k') | net/tools/quic/quic_spdy_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698