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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
6 | 6 |
7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 MockPacketWriter(); | 117 MockPacketWriter(); |
118 virtual ~MockPacketWriter(); | 118 virtual ~MockPacketWriter(); |
119 | 119 |
120 MOCK_METHOD5(WritePacket, | 120 MOCK_METHOD5(WritePacket, |
121 WriteResult(const char* buffer, | 121 WriteResult(const char* buffer, |
122 size_t buf_len, | 122 size_t buf_len, |
123 const IPAddressNumber& self_address, | 123 const IPAddressNumber& self_address, |
124 const IPEndPoint& peer_address, | 124 const IPEndPoint& peer_address, |
125 QuicBlockedWriterInterface* blocked_writer)); | 125 QuicBlockedWriterInterface* blocked_writer)); |
126 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); | 126 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); |
| 127 MOCK_CONST_METHOD0(IsWriteBlocked, bool()); |
| 128 MOCK_METHOD0(SetWritable, void()); |
127 }; | 129 }; |
128 | 130 |
129 class MockQuicSessionOwner : public QuicSessionOwner { | 131 class MockQuicSessionOwner : public QuicSessionOwner { |
130 public: | 132 public: |
131 MockQuicSessionOwner(); | 133 MockQuicSessionOwner(); |
132 virtual ~MockQuicSessionOwner(); | 134 virtual ~MockQuicSessionOwner(); |
133 MOCK_METHOD2(OnConnectionClosed, void(QuicGuid guid, QuicErrorCode error)); | 135 MOCK_METHOD2(OnConnectionClosed, void(QuicGuid guid, QuicErrorCode error)); |
134 }; | 136 }; |
135 | 137 |
136 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { | 138 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { |
137 public: | 139 public: |
138 virtual ~TestDecompressorVisitor() {} | 140 virtual ~TestDecompressorVisitor() {} |
139 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; | 141 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; |
140 virtual void OnDecompressionError() OVERRIDE; | 142 virtual void OnDecompressionError() OVERRIDE; |
141 | 143 |
142 std::string data() { return data_; } | 144 std::string data() { return data_; } |
143 bool error() { return error_; } | 145 bool error() { return error_; } |
144 | 146 |
145 private: | 147 private: |
146 std::string data_; | 148 std::string data_; |
147 bool error_; | 149 bool error_; |
148 }; | 150 }; |
149 | 151 |
150 class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface { | 152 class MockAckNotifierDelegate : public QuicAckNotifier::DelegateInterface { |
151 public: | 153 public: |
152 MockAckNotifierDelegate(); | 154 MockAckNotifierDelegate(); |
153 virtual ~MockAckNotifierDelegate(); | |
154 | 155 |
155 MOCK_METHOD0(OnAckNotification, void()); | 156 MOCK_METHOD0(OnAckNotification, void()); |
| 157 |
| 158 protected: |
| 159 // Object is ref counted. |
| 160 virtual ~MockAckNotifierDelegate(); |
156 }; | 161 }; |
157 | 162 |
158 } // namespace test | 163 } // namespace test |
159 } // namespace tools | 164 } // namespace tools |
160 } // namespace net | 165 } // namespace net |
161 | 166 |
162 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 167 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |