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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 has_load_timing_info_before_auth_ = true; | 498 has_load_timing_info_before_auth_ = true; |
499 EXPECT_FALSE(load_timing_info_before_auth_.request_start_time.is_null()); | 499 EXPECT_FALSE(load_timing_info_before_auth_.request_start_time.is_null()); |
500 EXPECT_FALSE(load_timing_info_before_auth_.request_start.is_null()); | 500 EXPECT_FALSE(load_timing_info_before_auth_.request_start.is_null()); |
501 | 501 |
502 int req_id = request->identifier(); | 502 int req_id = request->identifier(); |
503 InitRequestStatesIfNew(req_id); | 503 InitRequestStatesIfNew(req_id); |
504 event_order_[req_id] += "OnAuthRequired\n"; | 504 event_order_[req_id] += "OnAuthRequired\n"; |
505 EXPECT_TRUE(next_states_[req_id] & kStageAuthRequired) << | 505 EXPECT_TRUE(next_states_[req_id] & kStageAuthRequired) << |
506 event_order_[req_id]; | 506 event_order_[req_id]; |
507 next_states_[req_id] = kStageBeforeSendHeaders | | 507 next_states_[req_id] = kStageBeforeSendHeaders | |
| 508 kStageAuthRequired | // For example, proxy auth followed by server auth. |
508 kStageHeadersReceived | // Request canceled by delegate simulates empty | 509 kStageHeadersReceived | // Request canceled by delegate simulates empty |
509 // response. | 510 // response. |
510 kStageResponseStarted | // data: URLs do not trigger sending headers | 511 kStageResponseStarted | // data: URLs do not trigger sending headers |
511 kStageBeforeRedirect | // a delegate can trigger a redirection | 512 kStageBeforeRedirect | // a delegate can trigger a redirection |
512 kStageCompletedError; // request cancelled before callback | 513 kStageCompletedError; // request cancelled before callback |
513 return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; | 514 return NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; |
514 } | 515 } |
515 | 516 |
516 bool TestNetworkDelegate::OnCanGetCookies(const URLRequest& request, | 517 bool TestNetworkDelegate::OnCanGetCookies(const URLRequest& request, |
517 const CookieList& cookie_list) { | 518 const CookieList& cookie_list) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 URLRequestJob* job = main_intercept_job_; | 593 URLRequestJob* job = main_intercept_job_; |
593 main_intercept_job_ = NULL; | 594 main_intercept_job_ = NULL; |
594 return job; | 595 return job; |
595 } | 596 } |
596 | 597 |
597 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { | 598 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { |
598 main_intercept_job_ = job; | 599 main_intercept_job_ = job; |
599 } | 600 } |
600 | 601 |
601 } // namespace net | 602 } // namespace net |
OLD | NEW |