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 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 int response_started_count() const { return response_started_count_; } | 113 int response_started_count() const { return response_started_count_; } |
114 int received_redirect_count() const { return received_redirect_count_; } | 114 int received_redirect_count() const { return received_redirect_count_; } |
115 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } | 115 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } |
116 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } | 116 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } |
117 int set_cookie_count() const { return set_cookie_count_; } | 117 int set_cookie_count() const { return set_cookie_count_; } |
118 bool received_data_before_response() const { | 118 bool received_data_before_response() const { |
119 return received_data_before_response_; | 119 return received_data_before_response_; |
120 } | 120 } |
121 bool request_failed() const { return request_failed_; } | 121 bool request_failed() const { return request_failed_; } |
122 bool have_certificate_errors() const { return have_certificate_errors_; } | 122 bool have_certificate_errors() const { return have_certificate_errors_; } |
123 bool is_hsts_host() const { return is_hsts_host_; } | 123 bool fatal() const { return fatal_; } |
wtc
2012/01/13 01:39:57
This getter method and the data member should be n
palmer
2012/01/13 23:03:47
Done.
| |
124 bool auth_required_called() const { return auth_required_; } | 124 bool auth_required_called() const { return auth_required_; } |
125 | 125 |
126 // net::URLRequest::Delegate: | 126 // net::URLRequest::Delegate: |
127 virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, | 127 virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, |
128 bool* defer_redirect) OVERRIDE; | 128 bool* defer_redirect) OVERRIDE; |
129 virtual void OnAuthRequired(net::URLRequest* request, | 129 virtual void OnAuthRequired(net::URLRequest* request, |
130 net::AuthChallengeInfo* auth_info) OVERRIDE; | 130 net::AuthChallengeInfo* auth_info) OVERRIDE; |
131 virtual void OnSSLCertificateError(net::URLRequest* request, | 131 virtual void OnSSLCertificateError(net::URLRequest* request, |
132 const net::SSLInfo& ssl_info, | 132 const net::SSLInfo& ssl_info, |
133 bool is_hsts_host) OVERRIDE; | 133 bool fatal) OVERRIDE; |
wtc
2012/01/13 01:39:57
In contrast, this input parameter to a function ha
palmer
2012/01/13 23:03:47
Done.
| |
134 virtual bool CanGetCookies(const net::URLRequest* request, | 134 virtual bool CanGetCookies(const net::URLRequest* request, |
135 const net::CookieList& cookie_list) const OVERRIDE; | 135 const net::CookieList& cookie_list) const OVERRIDE; |
136 virtual bool CanSetCookie(const net::URLRequest* request, | 136 virtual bool CanSetCookie(const net::URLRequest* request, |
137 const std::string& cookie_line, | 137 const std::string& cookie_line, |
138 net::CookieOptions* options) const OVERRIDE; | 138 net::CookieOptions* options) const OVERRIDE; |
139 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 139 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
140 virtual void OnReadCompleted(net::URLRequest* request, | 140 virtual void OnReadCompleted(net::URLRequest* request, |
141 int bytes_read) OVERRIDE; | 141 int bytes_read) OVERRIDE; |
142 | 142 |
143 private: | 143 private: |
(...skipping 15 matching lines...) Expand all Loading... | |
159 // tracks status of callbacks | 159 // tracks status of callbacks |
160 int response_started_count_; | 160 int response_started_count_; |
161 int received_bytes_count_; | 161 int received_bytes_count_; |
162 int received_redirect_count_; | 162 int received_redirect_count_; |
163 mutable int blocked_get_cookies_count_; | 163 mutable int blocked_get_cookies_count_; |
164 mutable int blocked_set_cookie_count_; | 164 mutable int blocked_set_cookie_count_; |
165 mutable int set_cookie_count_; | 165 mutable int set_cookie_count_; |
166 bool received_data_before_response_; | 166 bool received_data_before_response_; |
167 bool request_failed_; | 167 bool request_failed_; |
168 bool have_certificate_errors_; | 168 bool have_certificate_errors_; |
169 bool is_hsts_host_; | 169 bool fatal_; |
170 bool auth_required_; | 170 bool auth_required_; |
171 std::string data_received_; | 171 std::string data_received_; |
172 | 172 |
173 // our read buffer | 173 // our read buffer |
174 scoped_refptr<net::IOBuffer> buf_; | 174 scoped_refptr<net::IOBuffer> buf_; |
175 }; | 175 }; |
176 | 176 |
177 //----------------------------------------------------------------------------- | 177 //----------------------------------------------------------------------------- |
178 | 178 |
179 class TestNetworkDelegate : public net::NetworkDelegate { | 179 class TestNetworkDelegate : public net::NetworkDelegate { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 // This bit-set indicates for each request id (key) what events may be sent | 231 // This bit-set indicates for each request id (key) what events may be sent |
232 // next. | 232 // next. |
233 std::map<int, int> next_states_; | 233 std::map<int, int> next_states_; |
234 | 234 |
235 // A log that records for each request id (key) the order in which On... | 235 // A log that records for each request id (key) the order in which On... |
236 // functions were called. | 236 // functions were called. |
237 std::map<int, std::string> event_order_; | 237 std::map<int, std::string> event_order_; |
238 }; | 238 }; |
239 | 239 |
240 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 240 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |