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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "net/base/capturing_net_log.h" | 10 #include "net/base/capturing_net_log.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 public: | 32 public: |
33 TestPacketWriter() { | 33 TestPacketWriter() { |
34 } | 34 } |
35 | 35 |
36 // QuicPacketWriter | 36 // QuicPacketWriter |
37 virtual WriteResult WritePacket( | 37 virtual WriteResult WritePacket( |
38 const char* buffer, size_t buf_len, | 38 const char* buffer, size_t buf_len, |
39 const IPAddressNumber& self_address, | 39 const IPAddressNumber& self_address, |
40 const IPEndPoint& peer_address, | 40 const IPEndPoint& peer_address, |
41 QuicBlockedWriterInterface* blocked_writer) OVERRIDE { | 41 QuicBlockedWriterInterface* blocked_writer) OVERRIDE { |
42 QuicFramer framer(QuicVersionMax(), QuicTime::Zero(), true); | 42 QuicFramer framer(QuicSupportedVersions(), QuicTime::Zero(), true); |
43 FramerVisitorCapturingFrames visitor; | 43 FramerVisitorCapturingFrames visitor; |
44 framer.set_visitor(&visitor); | 44 framer.set_visitor(&visitor); |
45 QuicEncryptedPacket packet(buffer, buf_len); | 45 QuicEncryptedPacket packet(buffer, buf_len); |
46 EXPECT_TRUE(framer.ProcessPacket(packet)); | 46 EXPECT_TRUE(framer.ProcessPacket(packet)); |
47 header_ = *visitor.header(); | 47 header_ = *visitor.header(); |
48 return WriteResult(WRITE_STATUS_OK, packet.length()); | 48 return WriteResult(WRITE_STATUS_OK, packet.length()); |
49 } | 49 } |
50 | 50 |
51 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE { | 51 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE { |
52 // Chrome sockets' Write() methods buffer the data until the Write is | 52 // Chrome sockets' Write() methods buffer the data until the Write is |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // After receiving a GoAway, I should no longer be able to create outgoing | 157 // After receiving a GoAway, I should no longer be able to create outgoing |
158 // streams. | 158 // streams. |
159 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 159 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
160 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); | 160 EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream()); |
161 } | 161 } |
162 | 162 |
163 } // namespace | 163 } // namespace |
164 } // namespace test | 164 } // namespace test |
165 } // namespace net | 165 } // namespace net |
OLD | NEW |