Chromium Code Reviews| 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 #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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 | 362 |
| 363 void TestNetworkDelegate::OnSendHeaders( | 363 void TestNetworkDelegate::OnSendHeaders( |
| 364 net::URLRequest* request, | 364 net::URLRequest* request, |
| 365 const net::HttpRequestHeaders& headers) { | 365 const net::HttpRequestHeaders& headers) { |
| 366 int req_id = request->identifier(); | 366 int req_id = request->identifier(); |
| 367 event_order_[req_id] += "OnSendHeaders\n"; | 367 event_order_[req_id] += "OnSendHeaders\n"; |
| 368 InitRequestStatesIfNew(req_id); | 368 InitRequestStatesIfNew(req_id); |
| 369 EXPECT_TRUE(next_states_[req_id] & kStageSendHeaders) << | 369 EXPECT_TRUE(next_states_[req_id] & kStageSendHeaders) << |
| 370 event_order_[req_id]; | 370 event_order_[req_id]; |
| 371 next_states_[req_id] = | 371 next_states_[req_id] = |
| 372 kStageBeforeRedirect | | 372 kStageBeforeRedirect | |
|
battre
2011/09/24 13:17:55
please add a kStageAuthRequired here and edit Test
| |
| 373 kStageResponseStarted | | 373 kStageResponseStarted | |
| 374 kStageCompletedError; // e.g. proxy resolution problem | 374 kStageCompletedError; // e.g. proxy resolution problem |
| 375 | 375 |
| 376 // Basic authentication sends a second request from the URLRequestHttpJob | 376 // Basic authentication sends a second request from the URLRequestHttpJob |
| 377 // layer before the URLRequest reports that a response has started. | 377 // layer before the URLRequest reports that a response has started. |
| 378 next_states_[req_id] |= kStageBeforeSendHeaders; | 378 next_states_[req_id] |= kStageBeforeSendHeaders; |
|
battre
2011/09/24 13:17:55
please delete this (if it is resolved)
| |
| 379 } | 379 } |
| 380 | 380 |
| 381 void TestNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, | 381 void TestNetworkDelegate::OnBeforeRedirect(net::URLRequest* request, |
| 382 const GURL& new_location) { | 382 const GURL& new_location) { |
| 383 int req_id = request->identifier(); | 383 int req_id = request->identifier(); |
| 384 event_order_[req_id] += "OnBeforeRedirect\n"; | 384 event_order_[req_id] += "OnBeforeRedirect\n"; |
| 385 InitRequestStatesIfNew(req_id); | 385 InitRequestStatesIfNew(req_id); |
| 386 EXPECT_TRUE(next_states_[req_id] & kStageBeforeRedirect) << | 386 EXPECT_TRUE(next_states_[req_id] & kStageBeforeRedirect) << |
| 387 event_order_[req_id]; | 387 event_order_[req_id]; |
| 388 next_states_[req_id] = | 388 next_states_[req_id] = |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 450 | 450 |
| 451 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( | 451 net::URLRequestJob* TestNetworkDelegate::OnMaybeCreateURLRequestJob( |
| 452 net::URLRequest* request) { | 452 net::URLRequest* request) { |
| 453 return NULL; | 453 return NULL; |
| 454 } | 454 } |
| 455 | 455 |
| 456 void TestNetworkDelegate::OnPACScriptError(int line_number, | 456 void TestNetworkDelegate::OnPACScriptError(int line_number, |
| 457 const string16& error) { | 457 const string16& error) { |
| 458 } | 458 } |
| 459 | 459 |
| 460 void TestNetworkDelegate::OnAuthRequired( | 460 int TestNetworkDelegate::OnAuthRequired( |
| 461 net::URLRequest* reqest, | 461 net::URLRequest* reqest, |
| 462 const net::AuthChallengeInfo& auth_info) { | 462 const net::AuthChallengeInfo& auth_info, |
| 463 net::CompletionCallback* callback, | |
| 464 net::AuthCredentials* credentials) { | |
| 465 return net::OK; | |
| 463 } | 466 } |
| OLD | NEW |