OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <algorithm> | 10 #include <algorithm> |
(...skipping 15 matching lines...) Expand all Loading... |
26 //----------------------------------------------------------------------------- | 26 //----------------------------------------------------------------------------- |
27 // mock transaction data | 27 // mock transaction data |
28 | 28 |
29 // these flags may be combined to form the test_mode field | 29 // these flags may be combined to form the test_mode field |
30 enum { | 30 enum { |
31 TEST_MODE_NORMAL = 0, | 31 TEST_MODE_NORMAL = 0, |
32 TEST_MODE_SYNC_NET_START = 1 << 0, | 32 TEST_MODE_SYNC_NET_START = 1 << 0, |
33 TEST_MODE_SYNC_NET_READ = 1 << 1, | 33 TEST_MODE_SYNC_NET_READ = 1 << 1, |
34 TEST_MODE_SYNC_CACHE_START = 1 << 2, | 34 TEST_MODE_SYNC_CACHE_START = 1 << 2, |
35 TEST_MODE_SYNC_CACHE_READ = 1 << 3, | 35 TEST_MODE_SYNC_CACHE_READ = 1 << 3, |
| 36 TEST_MODE_SYNC_CACHE_WRITE = 1 << 4, |
36 }; | 37 }; |
37 | 38 |
38 typedef void (*MockTransactionHandler)(const net::HttpRequestInfo* request, | 39 typedef void (*MockTransactionHandler)(const net::HttpRequestInfo* request, |
39 std::string* response_status, | 40 std::string* response_status, |
40 std::string* response_headers, | 41 std::string* response_headers, |
41 std::string* response_data); | 42 std::string* response_data); |
42 | 43 |
43 struct MockTransaction { | 44 struct MockTransaction { |
44 const char* url; | 45 const char* url; |
45 const char* method; | 46 const char* method; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 }; | 329 }; |
329 | 330 |
330 | 331 |
331 //----------------------------------------------------------------------------- | 332 //----------------------------------------------------------------------------- |
332 // helpers | 333 // helpers |
333 | 334 |
334 // read the transaction completely | 335 // read the transaction completely |
335 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 336 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
336 | 337 |
337 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 338 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
OLD | NEW |