OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
7 | 7 |
8 #include "net/http/http_transaction.h" | 8 #include "net/http/http_transaction.h" |
9 | 9 |
| 10 #include <stdint.h> |
| 11 |
10 #include <string> | 12 #include <string> |
11 | 13 |
12 #include "base/callback.h" | 14 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
14 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
15 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
16 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
17 #include "net/base/load_flags.h" | 19 #include "net/base/load_flags.h" |
18 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
19 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int Read(IOBuffer* buf, | 192 int Read(IOBuffer* buf, |
191 int buf_len, | 193 int buf_len, |
192 const CompletionCallback& callback) override; | 194 const CompletionCallback& callback) override; |
193 | 195 |
194 void StopCaching() override; | 196 void StopCaching() override; |
195 | 197 |
196 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; | 198 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; |
197 | 199 |
198 int64 GetTotalReceivedBytes() const override; | 200 int64 GetTotalReceivedBytes() const override; |
199 | 201 |
| 202 int64_t GetTotalSentBytes() const override; |
| 203 |
200 void DoneReading() override; | 204 void DoneReading() override; |
201 | 205 |
202 const HttpResponseInfo* GetResponseInfo() const override; | 206 const HttpResponseInfo* GetResponseInfo() const override; |
203 | 207 |
204 LoadState GetLoadState() const override; | 208 LoadState GetLoadState() const override; |
205 | 209 |
206 UploadProgress GetUploadProgress() const override; | 210 UploadProgress GetUploadProgress() const override; |
207 | 211 |
208 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; | 212 void SetQuicServerInfo(QuicServerInfo* quic_server_info) override; |
209 | 213 |
(...skipping 29 matching lines...) Expand all Loading... |
239 | 243 |
240 const HttpRequestInfo* request_; | 244 const HttpRequestInfo* request_; |
241 HttpResponseInfo response_; | 245 HttpResponseInfo response_; |
242 std::string data_; | 246 std::string data_; |
243 int data_cursor_; | 247 int data_cursor_; |
244 int test_mode_; | 248 int test_mode_; |
245 RequestPriority priority_; | 249 RequestPriority priority_; |
246 CreateHelper* websocket_handshake_stream_create_helper_; | 250 CreateHelper* websocket_handshake_stream_create_helper_; |
247 base::WeakPtr<MockNetworkLayer> transaction_factory_; | 251 base::WeakPtr<MockNetworkLayer> transaction_factory_; |
248 int64 received_bytes_; | 252 int64 received_bytes_; |
| 253 int64_t sent_bytes_; |
249 | 254 |
250 // NetLog ID of the fake / non-existent underlying socket used by the | 255 // NetLog ID of the fake / non-existent underlying socket used by the |
251 // connection. Requires Start() be passed a BoundNetLog with a real NetLog to | 256 // connection. Requires Start() be passed a BoundNetLog with a real NetLog to |
252 // be initialized. | 257 // be initialized. |
253 unsigned int socket_log_id_; | 258 unsigned int socket_log_id_; |
254 | 259 |
255 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; | 260 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; |
256 | 261 |
257 }; | 262 }; |
258 | 263 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 322 |
318 //----------------------------------------------------------------------------- | 323 //----------------------------------------------------------------------------- |
319 // helpers | 324 // helpers |
320 | 325 |
321 // read the transaction completely | 326 // read the transaction completely |
322 int ReadTransaction(HttpTransaction* trans, std::string* result); | 327 int ReadTransaction(HttpTransaction* trans, std::string* result); |
323 | 328 |
324 } // namespace net | 329 } // namespace net |
325 | 330 |
326 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 331 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
OLD | NEW |