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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 private: | 68 private: |
69 const bool has_mock_helper_; | 69 const bool has_mock_helper_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(MockConnection); | 71 DISALLOW_COPY_AND_ASSIGN(MockConnection); |
72 }; | 72 }; |
73 | 73 |
74 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { | 74 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { |
75 public: | 75 public: |
76 virtual ~TestDecompressorVisitor() {} | 76 virtual ~TestDecompressorVisitor() {} |
77 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; | 77 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; |
| 78 virtual void OnDecompressionError() OVERRIDE; |
78 | 79 |
79 std::string data() { return data_; } | 80 std::string data() { return data_; } |
| 81 bool error() { return error_; } |
80 | 82 |
81 private: | 83 private: |
82 std::string data_; | 84 std::string data_; |
| 85 bool error_; |
83 }; | 86 }; |
84 | 87 |
85 class TestSession : public QuicSession { | 88 class TestSession : public QuicSession { |
86 public: | 89 public: |
87 TestSession(QuicConnection* connection, bool is_server); | 90 TestSession(QuicConnection* connection, |
| 91 const QuicConfig& config, |
| 92 bool is_server); |
88 virtual ~TestSession(); | 93 virtual ~TestSession(); |
89 | 94 |
90 MOCK_METHOD1(CreateIncomingReliableStream, | 95 MOCK_METHOD1(CreateIncomingReliableStream, |
91 ReliableQuicStream*(QuicStreamId id)); | 96 ReliableQuicStream*(QuicStreamId id)); |
92 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); | 97 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); |
93 | 98 |
94 void SetCryptoStream(QuicCryptoStream* stream); | 99 void SetCryptoStream(QuicCryptoStream* stream); |
95 | 100 |
96 virtual QuicCryptoStream* GetCryptoStream(); | 101 virtual QuicCryptoStream* GetCryptoStream(); |
97 | 102 |
98 private: | 103 private: |
99 QuicCryptoStream* crypto_stream_; | 104 QuicCryptoStream* crypto_stream_; |
100 DISALLOW_COPY_AND_ASSIGN(TestSession); | 105 DISALLOW_COPY_AND_ASSIGN(TestSession); |
101 }; | 106 }; |
102 | 107 |
103 } // namespace test | 108 } // namespace test |
104 } // namespace tools | 109 } // namespace tools |
105 } // namespace net | 110 } // namespace net |
106 | 111 |
107 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 112 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |