| OLD | NEW |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ = CreateProxyServiceUsingMojoFactory( | 129 proxy_service_ = CreateProxyServiceUsingMojoFactory( |
| 130 this, new ProxyConfigServiceFixed( | 130 this, make_scoped_ptr(new ProxyConfigServiceFixed( |
| 131 ProxyConfig::CreateFromCustomPacURL(GURL(kPacUrl))), | 131 ProxyConfig::CreateFromCustomPacURL(GURL(kPacUrl)))), |
| 132 fetcher_, new DoNothingDhcpProxyScriptFetcher(), &mock_host_resolver_, | 132 fetcher_, new DoNothingDhcpProxyScriptFetcher(), &mock_host_resolver_, |
| 133 &net_log_, &network_delegate_); | 133 &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()); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |