| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 net::AuthCredentials* credentials) { | 448 net::AuthCredentials* credentials) { |
| 449 int req_id = request->identifier(); | 449 int req_id = request->identifier(); |
| 450 InitRequestStatesIfNew(req_id); | 450 InitRequestStatesIfNew(req_id); |
| 451 event_order_[req_id] += "OnAuthRequired\n"; | 451 event_order_[req_id] += "OnAuthRequired\n"; |
| 452 EXPECT_TRUE(next_states_[req_id] & kStageAuthRequired) << | 452 EXPECT_TRUE(next_states_[req_id] & kStageAuthRequired) << |
| 453 event_order_[req_id]; | 453 event_order_[req_id]; |
| 454 next_states_[req_id] = kStageBeforeSendHeaders | | 454 next_states_[req_id] = kStageBeforeSendHeaders | |
| 455 kStageHeadersReceived | // Request canceled by delegate simulates empty | 455 kStageHeadersReceived | // Request canceled by delegate simulates empty |
| 456 // response. | 456 // response. |
| 457 kStageResponseStarted | // data: URLs do not trigger sending headers | 457 kStageResponseStarted | // data: URLs do not trigger sending headers |
| 458 kStageBeforeRedirect; // a delegate can trigger a redirection | 458 kStageBeforeRedirect | // a delegate can trigger a redirection |
| 459 kStageCompletedError; // request cancelled before callback |
| 459 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; | 460 return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; |
| 460 } | 461 } |
| 461 | 462 |
| 462 bool TestNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, | 463 bool TestNetworkDelegate::OnCanGetCookies(const net::URLRequest& request, |
| 463 const net::CookieList& cookie_list) { | 464 const net::CookieList& cookie_list) { |
| 464 bool allow = true; | 465 bool allow = true; |
| 465 if (cookie_options_bit_mask_ & NO_GET_COOKIES) | 466 if (cookie_options_bit_mask_ & NO_GET_COOKIES) |
| 466 allow = false; | 467 allow = false; |
| 467 | 468 |
| 468 if (!allow) { | 469 if (!allow) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 550 |
| 550 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse( | 551 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse( |
| 551 net::URLRequest* request, | 552 net::URLRequest* request, |
| 552 net::NetworkDelegate* network_delegate) const { | 553 net::NetworkDelegate* network_delegate) const { |
| 553 return NULL; | 554 return NULL; |
| 554 } | 555 } |
| 555 | 556 |
| 556 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) { | 557 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) { |
| 557 main_intercept_job_ = job; | 558 main_intercept_job_ = job; |
| 558 } | 559 } |
| OLD | NEW |