Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: net/url_request/url_request_test_util.h

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: mac compile fix Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void set_cancel_in_received_data(bool val) { cancel_in_rd_ = val; } 100 void set_cancel_in_received_data(bool val) { cancel_in_rd_ = val; }
101 void set_cancel_in_received_data_pending(bool val) { 101 void set_cancel_in_received_data_pending(bool val) {
102 cancel_in_rd_pending_ = val; 102 cancel_in_rd_pending_ = val;
103 } 103 }
104 void set_quit_on_complete(bool val) { quit_on_complete_ = val; } 104 void set_quit_on_complete(bool val) { quit_on_complete_ = val; }
105 void set_quit_on_redirect(bool val) { quit_on_redirect_ = val; } 105 void set_quit_on_redirect(bool val) { quit_on_redirect_ = val; }
106 void set_allow_certificate_errors(bool val) { 106 void set_allow_certificate_errors(bool val) {
107 allow_certificate_errors_ = val; 107 allow_certificate_errors_ = val;
108 } 108 }
109 void set_cookie_options(int o) {cookie_options_bit_mask_ = o; } 109 void set_cookie_options(int o) {cookie_options_bit_mask_ = o; }
110 void set_username(const string16& u) { username_ = u; } 110 void set_credentials(const net::AuthCredentials& credentials) {
111 void set_password(const string16& p) { password_ = p; } 111 credentials_ = credentials;
112 }
112 113
113 // query state 114 // query state
114 const std::string& data_received() const { return data_received_; } 115 const std::string& data_received() const { return data_received_; }
115 int bytes_received() const { return static_cast<int>(data_received_.size()); } 116 int bytes_received() const { return static_cast<int>(data_received_.size()); }
116 int response_started_count() const { return response_started_count_; } 117 int response_started_count() const { return response_started_count_; }
117 int received_redirect_count() const { return received_redirect_count_; } 118 int received_redirect_count() const { return received_redirect_count_; }
118 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } 119 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; }
119 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } 120 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; }
120 int set_cookie_count() const { return set_cookie_count_; } 121 int set_cookie_count() const { return set_cookie_count_; }
121 bool received_data_before_response() const { 122 bool received_data_before_response() const {
(...skipping 27 matching lines...) Expand all
149 150
150 // options for controlling behavior 151 // options for controlling behavior
151 bool cancel_in_rr_; 152 bool cancel_in_rr_;
152 bool cancel_in_rs_; 153 bool cancel_in_rs_;
153 bool cancel_in_rd_; 154 bool cancel_in_rd_;
154 bool cancel_in_rd_pending_; 155 bool cancel_in_rd_pending_;
155 bool quit_on_complete_; 156 bool quit_on_complete_;
156 bool quit_on_redirect_; 157 bool quit_on_redirect_;
157 bool allow_certificate_errors_; 158 bool allow_certificate_errors_;
158 int cookie_options_bit_mask_; 159 int cookie_options_bit_mask_;
159 160 net::AuthCredentials credentials_;
160 string16 username_;
161 string16 password_;
162 161
163 // tracks status of callbacks 162 // tracks status of callbacks
164 int response_started_count_; 163 int response_started_count_;
165 int received_bytes_count_; 164 int received_bytes_count_;
166 int received_redirect_count_; 165 int received_redirect_count_;
167 mutable int blocked_get_cookies_count_; 166 mutable int blocked_get_cookies_count_;
168 mutable int blocked_set_cookie_count_; 167 mutable int blocked_set_cookie_count_;
169 mutable int set_cookie_count_; 168 mutable int set_cookie_count_;
170 bool received_data_before_response_; 169 bool received_data_before_response_;
171 bool request_failed_; 170 bool request_failed_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // This bit-set indicates for each request id (key) what events may be sent 233 // This bit-set indicates for each request id (key) what events may be sent
235 // next. 234 // next.
236 std::map<int, int> next_states_; 235 std::map<int, int> next_states_;
237 236
238 // A log that records for each request id (key) the order in which On... 237 // A log that records for each request id (key) the order in which On...
239 // functions were called. 238 // functions were called.
240 std::map<int, std::string> event_order_; 239 std::map<int, std::string> event_order_;
241 }; 240 };
242 241
243 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 242 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698