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

Unified Diff: net/url_request/url_request_ftp_job_unittest.cc

Issue 501163002: Make URLRequest's constructor private, and make URLRequestContext a friend class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge yet again Created 6 years, 3 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_filter_unittest.cc ('k') | net/url_request/url_request_http_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_ftp_job_unittest.cc
diff --git a/net/url_request/url_request_ftp_job_unittest.cc b/net/url_request/url_request_ftp_job_unittest.cc
index e672413228880bc2b1d43ef6ce03a129e065ddb7..0f77cea54ecebd4a3b613ca4f38884819f9fb23b 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -5,6 +5,7 @@
#include "net/url_request/url_request_ftp_job.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/run_loop.h"
#include "net/base/host_port_pair.h"
@@ -125,10 +126,10 @@ class URLRequestFtpJobPriorityTest : public testing::Test {
protected:
URLRequestFtpJobPriorityTest()
: proxy_service_(new SimpleProxyConfigService, NULL, NULL),
- req_(GURL("ftp://ftp.example.com"),
- DEFAULT_PRIORITY,
- &delegate_,
- &context_) {
+ req_(context_.CreateRequest(GURL("ftp://ftp.example.com"),
+ DEFAULT_PRIORITY,
+ &delegate_,
+ NULL)) {
context_.set_proxy_service(&proxy_service_);
context_.set_http_transaction_factory(&network_layer_);
}
@@ -139,14 +140,14 @@ class URLRequestFtpJobPriorityTest : public testing::Test {
FtpAuthCache ftp_auth_cache_;
TestURLRequestContext context_;
TestDelegate delegate_;
- TestURLRequest req_;
+ scoped_ptr<URLRequest> req_;
};
// Make sure that SetPriority actually sets the URLRequestFtpJob's
// priority, both before and after start.
TEST_F(URLRequestFtpJobPriorityTest, SetPriorityBasic) {
scoped_refptr<TestURLRequestFtpJob> job(new TestURLRequestFtpJob(
- &req_, &ftp_factory_, &ftp_auth_cache_));
+ req_.get(), &ftp_factory_, &ftp_auth_cache_));
EXPECT_EQ(DEFAULT_PRIORITY, job->priority());
job->SetPriority(LOWEST);
@@ -166,7 +167,7 @@ TEST_F(URLRequestFtpJobPriorityTest, SetPriorityBasic) {
// transaction on start.
TEST_F(URLRequestFtpJobPriorityTest, SetTransactionPriorityOnStart) {
scoped_refptr<TestURLRequestFtpJob> job(new TestURLRequestFtpJob(
- &req_, &ftp_factory_, &ftp_auth_cache_));
+ req_.get(), &ftp_factory_, &ftp_auth_cache_));
job->SetPriority(LOW);
EXPECT_FALSE(network_layer_.last_transaction());
@@ -181,7 +182,7 @@ TEST_F(URLRequestFtpJobPriorityTest, SetTransactionPriorityOnStart) {
// its transaction.
TEST_F(URLRequestFtpJobPriorityTest, SetTransactionPriority) {
scoped_refptr<TestURLRequestFtpJob> job(new TestURLRequestFtpJob(
- &req_, &ftp_factory_, &ftp_auth_cache_));
+ req_.get(), &ftp_factory_, &ftp_auth_cache_));
job->SetPriority(LOW);
job->Start();
ASSERT_TRUE(network_layer_.last_transaction());
@@ -195,7 +196,7 @@ TEST_F(URLRequestFtpJobPriorityTest, SetTransactionPriority) {
// newly-created transactions after the first one.
TEST_F(URLRequestFtpJobPriorityTest, SetSubsequentTransactionPriority) {
scoped_refptr<TestURLRequestFtpJob> job(new TestURLRequestFtpJob(
- &req_, &ftp_factory_, &ftp_auth_cache_));
+ req_.get(), &ftp_factory_, &ftp_auth_cache_));
job->Start();
job->SetPriority(LOW);
« no previous file with comments | « net/url_request/url_request_filter_unittest.cc ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698