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_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 QuicStreamOffset offset, | 288 QuicStreamOffset offset, |
289 bool fin)); | 289 bool fin)); |
290 MOCK_METHOD0(IsHandshakeComplete, bool()); | 290 MOCK_METHOD0(IsHandshakeComplete, bool()); |
291 | 291 |
292 private: | 292 private: |
293 DISALLOW_COPY_AND_ASSIGN(MockSession); | 293 DISALLOW_COPY_AND_ASSIGN(MockSession); |
294 }; | 294 }; |
295 | 295 |
296 class TestSession : public QuicSession { | 296 class TestSession : public QuicSession { |
297 public: | 297 public: |
298 TestSession(QuicConnection* connection, bool is_server); | 298 TestSession(QuicConnection* connection, |
| 299 const QuicConfig& config, |
| 300 bool is_server); |
299 virtual ~TestSession(); | 301 virtual ~TestSession(); |
300 | 302 |
301 MOCK_METHOD1(CreateIncomingReliableStream, | 303 MOCK_METHOD1(CreateIncomingReliableStream, |
302 ReliableQuicStream*(QuicStreamId id)); | 304 ReliableQuicStream*(QuicStreamId id)); |
303 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); | 305 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); |
304 | 306 |
305 void SetCryptoStream(QuicCryptoStream* stream); | 307 void SetCryptoStream(QuicCryptoStream* stream); |
306 | 308 |
307 virtual QuicCryptoStream* GetCryptoStream(); | 309 virtual QuicCryptoStream* GetCryptoStream(); |
308 | 310 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 virtual ~TestEntropyCalculator() { } | 346 virtual ~TestEntropyCalculator() { } |
345 | 347 |
346 virtual QuicPacketEntropyHash ReceivedEntropyHash( | 348 virtual QuicPacketEntropyHash ReceivedEntropyHash( |
347 QuicPacketSequenceNumber sequence_number) const OVERRIDE; | 349 QuicPacketSequenceNumber sequence_number) const OVERRIDE; |
348 }; | 350 }; |
349 | 351 |
350 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { | 352 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { |
351 public: | 353 public: |
352 virtual ~TestDecompressorVisitor() {} | 354 virtual ~TestDecompressorVisitor() {} |
353 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; | 355 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; |
| 356 virtual void OnDecompressionError() OVERRIDE; |
354 | 357 |
355 string data() { return data_; } | 358 string data() { return data_; } |
| 359 bool error() { return error_; } |
356 | 360 |
357 private: | 361 private: |
358 string data_; | 362 string data_; |
| 363 bool error_; |
359 }; | 364 }; |
360 | 365 |
361 } // namespace test | 366 } // namespace test |
362 } // namespace net | 367 } // namespace net |
363 | 368 |
364 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 369 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |