OLD | NEW |
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_epoll_connection_helper.h" | 5 #include "net/tools/quic/quic_epoll_connection_helper.h" |
6 | 6 |
7 #include "net/quic/crypto/crypto_protocol.h" | 7 #include "net/quic/crypto/crypto_protocol.h" |
8 #include "net/quic/crypto/quic_decrypter.h" | 8 #include "net/quic/crypto/quic_decrypter.h" |
9 #include "net/quic/crypto/quic_encrypter.h" | 9 #include "net/quic/crypto/quic_encrypter.h" |
10 #include "net/quic/crypto/quic_random.h" | 10 #include "net/quic/crypto/quic_random.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace net { | 26 namespace net { |
27 namespace tools { | 27 namespace tools { |
28 namespace test { | 28 namespace test { |
29 namespace { | 29 namespace { |
30 | 30 |
31 const char data1[] = "foo"; | 31 const char data1[] = "foo"; |
32 const bool kHasData = true; | 32 const bool kHasData = true; |
33 | 33 |
34 class TestConnectionHelper : public QuicEpollConnectionHelper { | 34 class TestConnectionHelper : public QuicEpollConnectionHelper { |
35 public: | 35 public: |
36 TestConnectionHelper(int fd, EpollServer* eps) | 36 TestConnectionHelper(int fd, EpollServer* eps) |
37 : QuicEpollConnectionHelper(fd, eps) { | 37 : QuicEpollConnectionHelper(fd, eps) { |
38 } | 38 } |
39 | 39 |
40 virtual int WritePacketToWire(const QuicEncryptedPacket& packet, | 40 virtual int WritePacketToWire(const QuicEncryptedPacket& packet, |
41 int* error) { | 41 int* error) OVERRIDE { |
42 QuicFramer framer(kQuicVersion1, | 42 QuicFramer framer(kQuicVersion1, |
43 QuicDecrypter::Create(kNULL), | 43 QuicDecrypter::Create(kNULL), |
44 QuicEncrypter::Create(kNULL), | 44 QuicEncrypter::Create(kNULL), |
45 QuicTime::Zero(), | 45 QuicTime::Zero(), |
46 true); | 46 true); |
47 FramerVisitorCapturingFrames visitor; | 47 FramerVisitorCapturingFrames visitor; |
48 framer.set_visitor(&visitor); | 48 framer.set_visitor(&visitor); |
49 EXPECT_TRUE(framer.ProcessPacket(packet)); | 49 EXPECT_TRUE(framer.ProcessPacket(packet)); |
50 header_ = *visitor.header(); | 50 header_ = *visitor.header(); |
51 *error = 0; | 51 *error = 0; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 testing::Return(QuicTime::Delta::Zero())); | 198 testing::Return(QuicTime::Delta::Zero())); |
199 EXPECT_CALL(visitor_, OnCanWrite()).WillOnce(testing::Return(true)); | 199 EXPECT_CALL(visitor_, OnCanWrite()).WillOnce(testing::Return(true)); |
200 epoll_server_.AdvanceByAndCallCallbacks(1); | 200 epoll_server_.AdvanceByAndCallCallbacks(1); |
201 EXPECT_EQ(0u, connection_.NumQueuedPackets()); | 201 EXPECT_EQ(0u, connection_.NumQueuedPackets()); |
202 } | 202 } |
203 | 203 |
204 } // namespace | 204 } // namespace |
205 } // namespace test | 205 } // namespace test |
206 } // namespace tools | 206 } // namespace tools |
207 } // namespace net | 207 } // namespace net |
OLD | NEW |