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

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

Issue 10905259: Refactor blocking network delegates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Both original BlockingNetworkDelegates merged into one Created 8 years, 3 months 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 | Annotate | Revision Log
OLDNEW
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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 522
522 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { 523 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
523 DCHECK_EQ(value_, new_value_); 524 DCHECK_EQ(value_, new_value_);
524 value_ = old_value_; 525 value_ = old_value_;
525 } 526 }
526 527
527 // static 528 // static
528 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { 529 const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
529 return value_; 530 return value_;
530 } 531 }
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_unittest.cc » ('j') | net/url_request/url_request_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698