| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 class TestPacketWriter : public QuicDefaultPacketWriter { | 31 class TestPacketWriter : public QuicDefaultPacketWriter { |
| 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) OVERRIDE { |
| 41 QuicBlockedWriterInterface* blocked_writer) OVERRIDE { | |
| 42 QuicFramer framer(QuicSupportedVersions(), QuicTime::Zero(), true); | 41 QuicFramer framer(QuicSupportedVersions(), QuicTime::Zero(), true); |
| 43 FramerVisitorCapturingFrames visitor; | 42 FramerVisitorCapturingFrames visitor; |
| 44 framer.set_visitor(&visitor); | 43 framer.set_visitor(&visitor); |
| 45 QuicEncryptedPacket packet(buffer, buf_len); | 44 QuicEncryptedPacket packet(buffer, buf_len); |
| 46 EXPECT_TRUE(framer.ProcessPacket(packet)); | 45 EXPECT_TRUE(framer.ProcessPacket(packet)); |
| 47 header_ = *visitor.header(); | 46 header_ = *visitor.header(); |
| 48 return WriteResult(WRITE_STATUS_OK, packet.length()); | 47 return WriteResult(WRITE_STATUS_OK, packet.length()); |
| 49 } | 48 } |
| 50 | 49 |
| 51 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE { | 50 virtual bool IsWriteBlockedDataBuffered() const OVERRIDE { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 157 |
| 159 // After receiving a GoAway, I should no longer be able to create outgoing | 158 // After receiving a GoAway, I should no longer be able to create outgoing |
| 160 // streams. | 159 // streams. |
| 161 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); | 160 session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away.")); |
| 162 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream()); | 161 EXPECT_EQ(NULL, session_.CreateOutgoingDataStream()); |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace | 164 } // namespace |
| 166 } // namespace test | 165 } // namespace test |
| 167 } // namespace net | 166 } // namespace net |
| OLD | NEW |