| 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 17 matching lines...) Expand all Loading... |
| 28 // mock transaction data | 28 // mock transaction data |
| 29 | 29 |
| 30 // these flags may be combined to form the test_mode field | 30 // these flags may be combined to form the test_mode field |
| 31 enum { | 31 enum { |
| 32 TEST_MODE_NORMAL = 0, | 32 TEST_MODE_NORMAL = 0, |
| 33 TEST_MODE_SYNC_NET_START = 1 << 0, | 33 TEST_MODE_SYNC_NET_START = 1 << 0, |
| 34 TEST_MODE_SYNC_NET_READ = 1 << 1, | 34 TEST_MODE_SYNC_NET_READ = 1 << 1, |
| 35 TEST_MODE_SYNC_CACHE_START = 1 << 2, | 35 TEST_MODE_SYNC_CACHE_START = 1 << 2, |
| 36 TEST_MODE_SYNC_CACHE_READ = 1 << 3, | 36 TEST_MODE_SYNC_CACHE_READ = 1 << 3, |
| 37 TEST_MODE_SYNC_CACHE_WRITE = 1 << 4, | 37 TEST_MODE_SYNC_CACHE_WRITE = 1 << 4, |
| 38 TEST_MODE_SYNC_ALL = TEST_MODE_SYNC_NET_START | TEST_MODE_SYNC_NET_READ | | 38 TEST_MODE_SYNC_ALL = (TEST_MODE_SYNC_NET_START | TEST_MODE_SYNC_NET_READ | |
| 39 TEST_MODE_SYNC_CACHE_START | TEST_MODE_SYNC_CACHE_READ | | 39 TEST_MODE_SYNC_CACHE_START | TEST_MODE_SYNC_CACHE_READ | |
| 40 TEST_MODE_SYNC_CACHE_WRITE | 40 TEST_MODE_SYNC_CACHE_WRITE) |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 typedef void (*MockTransactionHandler)(const net::HttpRequestInfo* request, | 43 typedef void (*MockTransactionHandler)(const net::HttpRequestInfo* request, |
| 44 std::string* response_status, | 44 std::string* response_status, |
| 45 std::string* response_headers, | 45 std::string* response_headers, |
| 46 std::string* response_data); | 46 std::string* response_data); |
| 47 | 47 |
| 48 struct MockTransaction { | 48 struct MockTransaction { |
| 49 const char* url; | 49 const char* url; |
| 50 const char* method; | 50 const char* method; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 }; | 343 }; |
| 344 | 344 |
| 345 | 345 |
| 346 //----------------------------------------------------------------------------- | 346 //----------------------------------------------------------------------------- |
| 347 // helpers | 347 // helpers |
| 348 | 348 |
| 349 // read the transaction completely | 349 // read the transaction completely |
| 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); | 350 int ReadTransaction(net::HttpTransaction* trans, std::string* result); |
| 351 | 351 |
| 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 352 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |