Index: net/proxy/proxy_script_fetcher_impl_unittest.cc |
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc |
index 8881161ab5873c95c38091c7e3dd357fe00be18c..070409171da7ea4ced32eaf7f3c125010988c542 100644 |
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc |
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc |
@@ -95,10 +95,10 @@ class RequestContext : public URLRequestContext { |
new CheckNoRevocationFlagSetInterceptor); |
} |
- private: |
- ~RequestContext() { |
+ virtual ~RequestContext() { |
} |
+ private: |
URLRequestContextStorage storage_; |
scoped_ptr<URLRequestJobFactory> url_request_job_factory_; |
}; |
@@ -133,8 +133,8 @@ class ProxyScriptFetcherImplTest : public PlatformTest { |
}; |
TEST_F(ProxyScriptFetcherImplTest, FileUrl) { |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
{ // Fetch a non-existent file. |
string16 text; |
@@ -161,8 +161,8 @@ TEST_F(ProxyScriptFetcherImplTest, FileUrl) { |
TEST_F(ProxyScriptFetcherImplTest, HttpMimeType) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
{ // Fetch a PAC with mime type "text/plain" |
GURL url(test_server_.GetURL("files/pac.txt")); |
@@ -196,8 +196,8 @@ TEST_F(ProxyScriptFetcherImplTest, HttpMimeType) { |
TEST_F(ProxyScriptFetcherImplTest, HttpStatusCode) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
{ // Fetch a PAC which gives a 500 -- FAIL |
GURL url(test_server_.GetURL("files/500.pac")); |
@@ -222,8 +222,8 @@ TEST_F(ProxyScriptFetcherImplTest, HttpStatusCode) { |
TEST_F(ProxyScriptFetcherImplTest, ContentDisposition) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
// Fetch PAC scripts via HTTP with a Content-Disposition header -- should |
// have no effect. |
@@ -239,8 +239,8 @@ TEST_F(ProxyScriptFetcherImplTest, ContentDisposition) { |
TEST_F(ProxyScriptFetcherImplTest, NoCache) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
// Fetch a PAC script whose HTTP headers make it cacheable for 1 hour. |
GURL url(test_server_.GetURL("files/cacheable_1hr.pac")); |
@@ -271,8 +271,8 @@ TEST_F(ProxyScriptFetcherImplTest, NoCache) { |
TEST_F(ProxyScriptFetcherImplTest, TooLarge) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
// Set the maximum response size to 50 bytes. |
int prev_size = pac_fetcher.SetSizeConstraint(50); |
@@ -312,8 +312,8 @@ TEST_F(ProxyScriptFetcherImplTest, TooLarge) { |
TEST_F(ProxyScriptFetcherImplTest, Hang) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
// Set the timeout period to 0.5 seconds. |
base::TimeDelta prev_timeout = pac_fetcher.SetTimeoutConstraint( |
@@ -350,8 +350,8 @@ TEST_F(ProxyScriptFetcherImplTest, Hang) { |
TEST_F(ProxyScriptFetcherImplTest, Encodings) { |
ASSERT_TRUE(test_server_.Start()); |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
// Test a response that is gzip-encoded -- should get inflated. |
{ |
@@ -378,8 +378,8 @@ TEST_F(ProxyScriptFetcherImplTest, Encodings) { |
} |
TEST_F(ProxyScriptFetcherImplTest, DataURLs) { |
- scoped_refptr<URLRequestContext> context(new RequestContext); |
- ProxyScriptFetcherImpl pac_fetcher(context); |
+ RequestContext context; |
+ ProxyScriptFetcherImpl pac_fetcher(&context); |
const char kEncodedUrl[] = |
"data:application/x-ns-proxy-autoconfig;base64,ZnVuY3Rpb24gRmluZFByb3h5R" |