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

Side by Side Diff: net/proxy/proxy_service_mojo_unittest.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Sync'd to revision p349162. Created 5 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 unified diff | Download patch
« no previous file with comments | « net/proxy/proxy_service_mojo.cc ('k') | net/proxy/proxy_service_v8.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_service_mojo.h" 5 #include "net/proxy/proxy_service_mojo.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 } // namespace 120 } // namespace
121 121
122 class ProxyServiceMojoTest : public testing::Test, 122 class ProxyServiceMojoTest : public testing::Test,
123 public MojoProxyResolverFactory { 123 public MojoProxyResolverFactory {
124 protected: 124 protected:
125 void SetUp() override { 125 void SetUp() override {
126 mock_host_resolver_.rules()->AddRule("example.com", "1.2.3.4"); 126 mock_host_resolver_.rules()->AddRule("example.com", "1.2.3.4");
127 127
128 fetcher_ = new MockProxyScriptFetcher; 128 fetcher_ = new MockProxyScriptFetcher;
129 proxy_service_.reset(CreateProxyServiceUsingMojoFactory( 129 proxy_service_ = CreateProxyServiceUsingMojoFactory(
130 this, new ProxyConfigServiceFixed( 130 this, new ProxyConfigServiceFixed(
131 ProxyConfig::CreateFromCustomPacURL(GURL(kPacUrl))), 131 ProxyConfig::CreateFromCustomPacURL(GURL(kPacUrl))),
132 fetcher_, make_scoped_ptr(new DoNothingDhcpProxyScriptFetcher()), 132 fetcher_, make_scoped_ptr(new DoNothingDhcpProxyScriptFetcher()),
133 &mock_host_resolver_, &net_log_, &network_delegate_)); 133 &mock_host_resolver_, &net_log_, &network_delegate_);
134 } 134 }
135 135
136 scoped_ptr<base::ScopedClosureRunner> CreateResolver( 136 scoped_ptr<base::ScopedClosureRunner> CreateResolver(
137 const mojo::String& pac_script, 137 const mojo::String& pac_script,
138 mojo::InterfaceRequest<interfaces::ProxyResolver> req, 138 mojo::InterfaceRequest<interfaces::ProxyResolver> req,
139 interfaces::ProxyResolverFactoryRequestClientPtr client) override { 139 interfaces::ProxyResolverFactoryRequestClientPtr client) override {
140 InProcessMojoProxyResolverFactory::GetInstance()->CreateResolver( 140 InProcessMojoProxyResolverFactory::GetInstance()->CreateResolver(
141 pac_script, req.Pass(), client.Pass()); 141 pac_script, req.Pass(), client.Pass());
142 return make_scoped_ptr( 142 return make_scoped_ptr(
143 new base::ScopedClosureRunner(on_delete_closure_.closure())); 143 new base::ScopedClosureRunner(on_delete_closure_.closure()));
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 EXPECT_EQ(OK, callback.WaitForResult()); 253 EXPECT_EQ(OK, callback.WaitForResult());
254 EXPECT_EQ("DIRECT", info.ToPacString()); 254 EXPECT_EQ("DIRECT", info.ToPacString());
255 EXPECT_EQ(0u, mock_host_resolver_.num_resolve()); 255 EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
256 256
257 TestNetLogEntry::List entries; 257 TestNetLogEntry::List entries;
258 net_log_.GetEntries(&entries); 258 net_log_.GetEntries(&entries);
259 CheckCapturedNetLogEntries(entries); 259 CheckCapturedNetLogEntries(entries);
260 } 260 }
261 261
262 } // namespace net 262 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service_mojo.cc ('k') | net/proxy/proxy_service_v8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698