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

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

Issue 10559036: Added URLRequestContext to constructor for URLRequest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated unittests Created 8 years, 6 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 base::WorkerPool::GetTaskRunner(true))); 105 base::WorkerPool::GetTaskRunner(true)));
106 } 106 }
107 if (accept_language().empty()) 107 if (accept_language().empty())
108 set_accept_language("en-us,fr"); 108 set_accept_language("en-us,fr");
109 if (accept_charset().empty()) 109 if (accept_charset().empty())
110 set_accept_charset("iso-8859-1,*,utf-8"); 110 set_accept_charset("iso-8859-1,*,utf-8");
111 if (!job_factory()) 111 if (!job_factory())
112 context_storage_.set_job_factory(new net::URLRequestJobFactory); 112 context_storage_.set_job_factory(new net::URLRequestJobFactory);
113 } 113 }
114 114
115 TestURLRequest::TestURLRequest(const GURL& url, Delegate* delegate) 115 TestURLRequest::TestURLRequest(const GURL& url,
116 : net::URLRequest(url, delegate), 116 Delegate* delegate,
117 context_(new TestURLRequestContext) { 117 TestURLRequestContext* context)
118 set_context(context_.get()); 118 : net::URLRequest(url, delegate, context) {
119 } 119 }
120 120
121 TestURLRequest::~TestURLRequest() { 121 TestURLRequest::~TestURLRequest() {
122 set_context(NULL);
123 } 122 }
124 123
125 TestURLRequestContextGetter::TestURLRequestContextGetter( 124 TestURLRequestContextGetter::TestURLRequestContextGetter(
126 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) 125 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
127 : io_message_loop_proxy_(io_message_loop_proxy) { 126 : io_message_loop_proxy_(io_message_loop_proxy) {
128 DCHECK(io_message_loop_proxy.get()); 127 DCHECK(io_message_loop_proxy.get());
129 } 128 }
130 129
131 TestURLRequestContextGetter::TestURLRequestContextGetter( 130 TestURLRequestContextGetter::TestURLRequestContextGetter(
132 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy, 131 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy,
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 509
511 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { 510 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
512 DCHECK_EQ(value_, new_value_); 511 DCHECK_EQ(value_, new_value_);
513 value_ = old_value_; 512 value_ = old_value_;
514 } 513 }
515 514
516 // static 515 // static
517 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { 516 const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
518 return value_; 517 return value_;
519 } 518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698