Index: net/proxy/proxy_service_unittest.cc |
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc |
index 6d6c747d954df093958bc2256107ebc9f5e5982b..9aa08c878e3c2b91c63b24fa838ba567b5662633 100644 |
--- a/net/proxy/proxy_service_unittest.cc |
+++ b/net/proxy/proxy_service_unittest.cc |
@@ -943,8 +943,9 @@ TEST_F(ProxyServiceTest, ProxyResolverFailsParsingJavaScriptMandatoryPac) { |
ProxyService service(config_service, make_scoped_ptr(factory), NULL); |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
- DhcpProxyScriptFetcher* dhcp_fetcher = new DoNothingDhcpProxyScriptFetcher(); |
- service.SetProxyScriptFetchers(fetcher, dhcp_fetcher); |
+ scoped_ptr<DhcpProxyScriptFetcher> dhcp_fetcher( |
eroman
2015/08/19 22:08:39
Please remove this variable and inline it into the
Paritosh Kumar
2015/08/20 15:23:35
Done.
|
+ new DoNothingDhcpProxyScriptFetcher()); |
+ service.SetProxyScriptFetchers(fetcher, dhcp_fetcher.Pass()); |
// Start resolve request. |
GURL url("http://www.google.com/"); |
@@ -1860,7 +1861,8 @@ TEST_F(ProxyServiceTest, InitialPACScriptDownload) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
eroman
2015/08/19 22:08:39
optional: You can probably use:
make_scoped_pt
Paritosh Kumar
2015/08/20 15:23:35
Done.
|
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 3 requests. |
@@ -1967,7 +1969,8 @@ TEST_F(ProxyServiceTest, ChangeScriptFetcherWhilePACDownloadInProgress) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 2 requests. |
@@ -1997,7 +2000,8 @@ TEST_F(ProxyServiceTest, ChangeScriptFetcherWhilePACDownloadInProgress) { |
fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
eroman
2015/08/19 22:08:39
See comment above, and throughout this file.
Paritosh Kumar
2015/08/20 15:23:35
Done.
|
+ new DoNothingDhcpProxyScriptFetcher())); |
// Nothing has been sent to the factory yet. |
EXPECT_TRUE(factory->pending_requests().empty()); |
@@ -2028,7 +2032,8 @@ TEST_F(ProxyServiceTest, CancelWhilePACFetching) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 3 requests. |
ProxyInfo info1; |
@@ -2123,7 +2128,8 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomPac) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 2 requests. |
@@ -2203,7 +2209,8 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomPac2) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 2 requests. |
@@ -2278,7 +2285,8 @@ TEST_F(ProxyServiceTest, FallbackFromAutodetectToCustomToManual) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 2 requests. |
@@ -2339,7 +2347,8 @@ TEST_F(ProxyServiceTest, BypassDoesntApplyToPac) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 requests. |
@@ -2408,7 +2417,8 @@ TEST_F(ProxyServiceTest, DeleteWhileInitProxyResolverHasOutstandingFetch) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |
@@ -2543,7 +2553,8 @@ TEST_F(ProxyServiceTest, NetworkChangeTriggersPacRefetch) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Disable the "wait after IP address changes" hack, so this unit-test can |
// complete quickly. |
@@ -2663,7 +2674,8 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterFailure) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |
@@ -2768,7 +2780,8 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterContentChange) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |
@@ -2879,7 +2892,8 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterContentUnchanged) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |
@@ -2987,7 +3001,8 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterSuccess) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |
@@ -3140,7 +3155,8 @@ TEST_F(ProxyServiceTest, PACScriptRefetchAfterActivity) { |
MockProxyScriptFetcher* fetcher = new MockProxyScriptFetcher; |
service.SetProxyScriptFetchers(fetcher, |
- new DoNothingDhcpProxyScriptFetcher()); |
+ scoped_ptr<DhcpProxyScriptFetcher>( |
+ new DoNothingDhcpProxyScriptFetcher())); |
// Start 1 request. |