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

Unified Diff: net/url_request/url_request_context_builder_unittest.cc

Issue 407093011: Allow URLRequests from one context to have different NetworkDelegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new tests Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_context.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder_unittest.cc
diff --git a/net/url_request/url_request_context_builder_unittest.cc b/net/url_request/url_request_context_builder_unittest.cc
index a7a0fee75d61c7f0024271f978b4653069e09e76..b5a3da23b39e195b46f2a5f431bc1b2357ee0edc 100644
--- a/net/url_request/url_request_context_builder_unittest.cc
+++ b/net/url_request/url_request_context_builder_unittest.cc
@@ -4,6 +4,7 @@
#include "net/url_request/url_request_context_builder.h"
+#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "net/base/request_priority.h"
#include "net/http/http_auth_handler.h"
@@ -79,13 +80,14 @@ TEST_F(URLRequestContextBuilderTest, DefaultSettings) {
scoped_ptr<URLRequestContext> context(builder_.Build());
TestDelegate delegate;
- URLRequest request(test_server_.GetURL("echoheader?Foo"),
- DEFAULT_PRIORITY,
- &delegate,
- context.get());
- request.set_method("GET");
- request.SetExtraRequestHeaderByName("Foo", "Bar", false);
- request.Start();
+ scoped_ptr<URLRequest> request(
+ context->CreateRequest(test_server_.GetURL("echoheader?Foo"),
+ DEFAULT_PRIORITY,
+ &delegate,
+ context->cookie_store()));
+ request->set_method("GET");
+ request->SetExtraRequestHeaderByName("Foo", "Bar", false);
+ request->Start();
base::MessageLoop::current()->Run();
EXPECT_EQ("Bar", delegate.data_received());
}
@@ -96,12 +98,13 @@ TEST_F(URLRequestContextBuilderTest, UserAgent) {
builder_.set_user_agent("Bar");
scoped_ptr<URLRequestContext> context(builder_.Build());
TestDelegate delegate;
- URLRequest request(test_server_.GetURL("echoheader?User-Agent"),
- DEFAULT_PRIORITY,
- &delegate,
- context.get());
- request.set_method("GET");
- request.Start();
+ scoped_ptr<URLRequest> request(
+ context->CreateRequest(test_server_.GetURL("echoheader?User-Agent"),
+ DEFAULT_PRIORITY,
+ &delegate,
+ NULL));
+ request->set_method("GET");
+ request->Start();
base::MessageLoop::current()->Run();
EXPECT_EQ("Bar", delegate.data_received());
}
« no previous file with comments | « net/url_request/url_request_context.cc ('k') | net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698