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

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

Issue 10919317: Move TestJobInterceptor to url_request_test_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix typo 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
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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { 522 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
523 DCHECK_EQ(value_, new_value_); 523 DCHECK_EQ(value_, new_value_);
524 value_ = old_value_; 524 value_ = old_value_;
525 } 525 }
526 526
527 // static 527 // static
528 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { 528 const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
529 return value_; 529 return value_;
530 } 530 }
531
532 TestJobInterceptor::TestJobInterceptor() : main_intercept_job_(NULL) {
533 }
534
535 net::URLRequestJob* TestJobInterceptor::MaybeIntercept(
536 net::URLRequest* request,
537 net::NetworkDelegate* network_delegate) const {
538 net::URLRequestJob* job = main_intercept_job_;
539 main_intercept_job_ = NULL;
540 return job;
541 }
542
543 net::URLRequestJob* TestJobInterceptor::MaybeInterceptRedirect(
544 const GURL& location,
545 net::URLRequest* request,
546 net::NetworkDelegate* network_delegate) const {
547 return NULL;
548 }
549
550 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse(
551 net::URLRequest* request,
552 net::NetworkDelegate* network_delegate) const {
553 return NULL;
554 }
555
556 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) {
557 main_intercept_job_ = job;
558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698