| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| 11 #include <sstream> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/string16.h" | 18 #include "base/string16.h" |
| 19 #include "base/time.h" | 19 #include "base/time.h" |
| 20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 21 #include "googleurl/src/url_util.h" | 21 #include "googleurl/src/url_util.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 #include "net/http/http_cache.h" | 32 #include "net/http/http_cache.h" |
| 33 #include "net/http/http_network_layer.h" | 33 #include "net/http/http_network_layer.h" |
| 34 #include "net/proxy/proxy_service.h" | 34 #include "net/proxy/proxy_service.h" |
| 35 #include "net/url_request/url_request.h" | 35 #include "net/url_request/url_request.h" |
| 36 #include "net/url_request/url_request_context.h" | 36 #include "net/url_request/url_request_context.h" |
| 37 #include "net/url_request/url_request_context_storage.h" | 37 #include "net/url_request/url_request_context_storage.h" |
| 38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 39 | 39 |
| 40 using base::TimeDelta; | 40 using base::TimeDelta; |
| 41 | 41 |
| 42 namespace net { | |
| 43 class HostPortPair; | |
| 44 } | |
| 45 | |
| 46 //----------------------------------------------------------------------------- | 42 //----------------------------------------------------------------------------- |
| 47 | 43 |
| 48 class TestURLRequestContext : public net::URLRequestContext { | 44 class TestURLRequestContext : public net::URLRequestContext { |
| 49 public: | 45 public: |
| 50 TestURLRequestContext(); | 46 TestURLRequestContext(); |
| 51 // Default constructor like TestURLRequestContext() but does not call | 47 // Default constructor like TestURLRequestContext() but does not call |
| 52 // Init() in case |delay_initialization| is true. This allows modifying the | 48 // Init() in case |delay_initialization| is true. This allows modifying the |
| 53 // URLRequestContext before it is constructed completely. If | 49 // URLRequestContext before it is constructed completely. If |
| 54 // |delay_initialization| is true, Init() needs be be called manually. | 50 // |delay_initialization| is true, Init() needs be be called manually. |
| 55 explicit TestURLRequestContext(bool delay_initialization); | 51 explicit TestURLRequestContext(bool delay_initialization); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // This bit-set indicates for each request id (key) what events may be sent | 229 // This bit-set indicates for each request id (key) what events may be sent |
| 234 // next. | 230 // next. |
| 235 std::map<int, int> next_states_; | 231 std::map<int, int> next_states_; |
| 236 | 232 |
| 237 // A log that records for each request id (key) the order in which On... | 233 // A log that records for each request id (key) the order in which On... |
| 238 // functions were called. | 234 // functions were called. |
| 239 std::map<int, std::string> event_order_; | 235 std::map<int, std::string> event_order_; |
| 240 }; | 236 }; |
| 241 | 237 |
| 242 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 238 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
| OLD | NEW |