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

Unified Diff: net/url_request/url_request_job_unittest.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialize to NULL Created 8 years, 7 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_job_factory_unittest.cc ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job_unittest.cc
diff --git a/net/url_request/url_request_job_unittest.cc b/net/url_request/url_request_job_unittest.cc
index 017b98b061ef57d9cbea312143ecf412105cee73..0f7fd306f676653634857afa70709601ba598c6e 100644
--- a/net/url_request/url_request_job_unittest.cc
+++ b/net/url_request/url_request_job_unittest.cc
@@ -39,15 +39,15 @@ const MockTransaction kGZip_Transaction = {
} // namespace
TEST(URLRequestJob, TransactionNotifiedWhenDone) {
- TestDelegate d;
- TestURLRequest req(GURL(kGZip_Transaction.url), &d);
MockNetworkLayer network_layer;
+ TestURLRequestContext context;
+ context.set_http_transaction_factory(&network_layer);
+ TestDelegate d;
+ TestURLRequest req(GURL(kGZip_Transaction.url), &d);
AddMockTransaction(&kGZip_Transaction);
- scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
- context->set_http_transaction_factory(&network_layer);
- req.set_context(context);
+ req.set_context(&context);
req.set_method("GET");
req.Start();
@@ -59,17 +59,17 @@ TEST(URLRequestJob, TransactionNotifiedWhenDone) {
}
TEST(URLRequestJob, SyncTransactionNotifiedWhenDone) {
- TestDelegate d;
- TestURLRequest req(GURL(kGZip_Transaction.url), &d);
MockNetworkLayer network_layer;
+ TestURLRequestContext context;
+ context.set_http_transaction_factory(&network_layer);
+ TestDelegate d;
+ TestURLRequest req(GURL(kGZip_Transaction.url), &d);
MockTransaction transaction(kGZip_Transaction);
transaction.test_mode = TEST_MODE_SYNC_ALL;
AddMockTransaction(&transaction);
- scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
- context->set_http_transaction_factory(&network_layer);
- req.set_context(context);
+ req.set_context(&context);
req.set_method("GET");
req.Start();
« no previous file with comments | « net/url_request/url_request_job_factory_unittest.cc ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698