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

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

Issue 379293002: Add AssertNoURLRequests() to URLRequestContext subclass destructors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to two omitted subclasses of subclasses of URLRequestContext. Created 6 years, 5 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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 TestURLRequestContext::TestURLRequestContext(bool delay_initialization) 54 TestURLRequestContext::TestURLRequestContext(bool delay_initialization)
55 : initialized_(false), 55 : initialized_(false),
56 client_socket_factory_(NULL), 56 client_socket_factory_(NULL),
57 context_storage_(this) { 57 context_storage_(this) {
58 if (!delay_initialization) 58 if (!delay_initialization)
59 Init(); 59 Init();
60 } 60 }
61 61
62 TestURLRequestContext::~TestURLRequestContext() { 62 TestURLRequestContext::~TestURLRequestContext() {
63 DCHECK(initialized_); 63 DCHECK(initialized_);
64 AssertNoURLRequests();
64 } 65 }
65 66
66 void TestURLRequestContext::Init() { 67 void TestURLRequestContext::Init() {
67 DCHECK(!initialized_); 68 DCHECK(!initialized_);
68 initialized_ = true; 69 initialized_ = true;
69 70
70 if (!host_resolver()) 71 if (!host_resolver())
71 context_storage_.set_host_resolver( 72 context_storage_.set_host_resolver(
72 scoped_ptr<HostResolver>(new MockCachingHostResolver())); 73 scoped_ptr<HostResolver>(new MockCachingHostResolver()));
73 if (!proxy_service()) 74 if (!proxy_service())
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 URLRequestJob* job = main_intercept_job_; 642 URLRequestJob* job = main_intercept_job_;
642 main_intercept_job_ = NULL; 643 main_intercept_job_ = NULL;
643 return job; 644 return job;
644 } 645 }
645 646
646 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { 647 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) {
647 main_intercept_job_ = job; 648 main_intercept_job_ = job;
648 } 649 }
649 650
650 } // namespace net 651 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_builder.cc ('k') | net/url_request/view_cache_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698