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

Unified Diff: net/spdy/spdy_network_transaction_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: And fix more stuff... 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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/spdy_network_transaction_unittest.cc
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 2b5d60f02f45039118edf3e096150d82aa849ff7..86a5062ab87f219a79e5ea3b0f19b230364580d9 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -2496,26 +2496,27 @@ TEST_P(SpdyNetworkTransactionTest, RedirectGetRequest) {
GetParam().protocol,
false /* force_spdy_over_ssl*/,
true /* force_spdy_always */);
- net::URLRequest r(GURL("http://www.google.com/"),
- DEFAULT_PRIORITY,
- &d,
- &spdy_url_request_context);
+ scoped_ptr<URLRequest> r(
+ spdy_url_request_context.CreateRequest(GURL("http://www.google.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ NULL));
spdy_url_request_context.socket_factory().
AddSocketDataProvider(&data);
spdy_url_request_context.socket_factory().
AddSocketDataProvider(&data2);
d.set_quit_on_redirect(true);
- r.Start();
+ r->Start();
base::RunLoop().Run();
EXPECT_EQ(1, d.received_redirect_count());
- r.FollowDeferredRedirect();
+ r->FollowDeferredRedirect();
base::RunLoop().Run();
EXPECT_EQ(1, d.response_started_count());
EXPECT_FALSE(d.received_data_before_response());
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, r.status().status());
+ EXPECT_EQ(net::URLRequestStatus::SUCCESS, r->status().status());
std::string contents("hello!");
EXPECT_EQ(contents, d.data_received());
}
@@ -2590,37 +2591,40 @@ TEST_P(SpdyNetworkTransactionTest, RedirectServerPush) {
false /* force_spdy_over_ssl*/,
true /* force_spdy_always */);
{
- net::URLRequest r(GURL("http://www.google.com/"),
- DEFAULT_PRIORITY,
- &d,
- &spdy_url_request_context);
+ scoped_ptr<URLRequest> r(
+ spdy_url_request_context.CreateRequest(GURL("http://www.google.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ NULL));
spdy_url_request_context.socket_factory().
AddSocketDataProvider(&data);
- r.Start();
+ r->Start();
base::RunLoop().Run();
EXPECT_EQ(0, d.received_redirect_count());
std::string contents("hello!");
EXPECT_EQ(contents, d.data_received());
- net::URLRequest r2(GURL("http://www.google.com/foo.dat"),
- DEFAULT_PRIORITY,
- &d2,
- &spdy_url_request_context);
+ scoped_ptr<URLRequest> r2(
+ spdy_url_request_context.CreateRequest(
+ GURL("http://www.google.com/foo.dat"),
+ DEFAULT_PRIORITY,
+ &d2,
+ NULL));
spdy_url_request_context.socket_factory().
AddSocketDataProvider(&data2);
d2.set_quit_on_redirect(true);
- r2.Start();
+ r2->Start();
base::RunLoop().Run();
EXPECT_EQ(1, d2.received_redirect_count());
- r2.FollowDeferredRedirect();
+ r2->FollowDeferredRedirect();
base::RunLoop().Run();
EXPECT_EQ(1, d2.response_started_count());
EXPECT_FALSE(d2.received_data_before_response());
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, r2.status().status());
+ EXPECT_EQ(net::URLRequestStatus::SUCCESS, r2->status().status());
std::string contents2("hello!");
EXPECT_EQ(contents2, d2.data_received());
}

Powered by Google App Engine
This is Rietveld 408576698