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 |
| 6 |
5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
7 | 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
11 #include "net/quic/quic_connection.h" | 13 #include "net/quic/quic_connection.h" |
12 #include "net/quic/quic_packet_writer.h" | 14 #include "net/quic/quic_packet_writer.h" |
13 #include "net/quic/quic_session.h" | 15 #include "net/quic/quic_session.h" |
14 #include "net/quic/quic_spdy_decompressor.h" | 16 #include "net/quic/quic_spdy_decompressor.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 size_t buf_len, | 122 size_t buf_len, |
121 const IPAddressNumber& self_address, | 123 const IPAddressNumber& self_address, |
122 const IPEndPoint& peer_address, | 124 const IPEndPoint& peer_address, |
123 QuicBlockedWriterInterface* blocked_writer)); | 125 QuicBlockedWriterInterface* blocked_writer)); |
124 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); | 126 MOCK_CONST_METHOD0(IsWriteBlockedDataBuffered, bool()); |
125 }; | 127 }; |
126 | 128 |
127 class MockQuicSessionOwner : public QuicSessionOwner { | 129 class MockQuicSessionOwner : public QuicSessionOwner { |
128 public: | 130 public: |
129 MockQuicSessionOwner(); | 131 MockQuicSessionOwner(); |
130 ~MockQuicSessionOwner(); | 132 virtual ~MockQuicSessionOwner(); |
131 MOCK_METHOD2(OnConnectionClosed, void(QuicGuid guid, QuicErrorCode error)); | 133 MOCK_METHOD2(OnConnectionClosed, void(QuicGuid guid, QuicErrorCode error)); |
132 }; | 134 }; |
133 | 135 |
134 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { | 136 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { |
135 public: | 137 public: |
136 virtual ~TestDecompressorVisitor() {} | 138 virtual ~TestDecompressorVisitor() {} |
137 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; | 139 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE; |
138 virtual void OnDecompressionError() OVERRIDE; | 140 virtual void OnDecompressionError() OVERRIDE; |
139 | 141 |
140 std::string data() { return data_; } | 142 std::string data() { return data_; } |
(...skipping 10 matching lines...) Expand all Loading... |
151 virtual ~MockAckNotifierDelegate(); | 153 virtual ~MockAckNotifierDelegate(); |
152 | 154 |
153 MOCK_METHOD0(OnAckNotification, void()); | 155 MOCK_METHOD0(OnAckNotification, void()); |
154 }; | 156 }; |
155 | 157 |
156 } // namespace test | 158 } // namespace test |
157 } // namespace tools | 159 } // namespace tools |
158 } // namespace net | 160 } // namespace net |
159 | 161 |
160 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 162 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |