| 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_resolver_mojo.h" | 5 #include "net/proxy/proxy_resolver_mojo.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 blocked_clients_.push_back( | 248 blocked_clients_.push_back( |
| 249 new interfaces::ProxyResolverRequestClientPtr(client.Pass())); | 249 new interfaces::ProxyResolverRequestClientPtr(client.Pass())); |
| 250 break; | 250 break; |
| 251 } | 251 } |
| 252 WakeWaiter(); | 252 WakeWaiter(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory { | 255 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory { |
| 256 public: | 256 public: |
| 257 TestMojoProxyResolverFactory(); | 257 TestMojoProxyResolverFactory(); |
| 258 ~TestMojoProxyResolverFactory(); | 258 ~TestMojoProxyResolverFactory() override; |
| 259 | 259 |
| 260 // Overridden from MojoProxyResolverFactory: | 260 // Overridden from MojoProxyResolverFactory: |
| 261 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req, | 261 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req, |
| 262 interfaces::HostResolverPtr host_resolver) override; | 262 interfaces::HostResolverPtr host_resolver) override; |
| 263 | 263 |
| 264 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; } | 264 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; } |
| 265 | 265 |
| 266 void AddFuturePacScriptAction(int creation, SetPacScriptAction action); | 266 void AddFuturePacScriptAction(int creation, SetPacScriptAction action); |
| 267 void AddFutureGetProxyAction(int creation, GetProxyForUrlAction action); | 267 void AddFutureGetProxyAction(int creation, GetProxyForUrlAction action); |
| 268 | 268 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 // resolve request. | 726 // resolve request. |
| 727 scoped_ptr<Request> request(MakeRequest(GURL(kExampleUrl))); | 727 scoped_ptr<Request> request(MakeRequest(GURL(kExampleUrl))); |
| 728 EXPECT_EQ(ERR_IO_PENDING, request->Resolve()); | 728 EXPECT_EQ(ERR_IO_PENDING, request->Resolve()); |
| 729 EXPECT_EQ(OK, request->WaitForResult()); | 729 EXPECT_EQ(OK, request->WaitForResult()); |
| 730 EXPECT_EQ("DIRECT", request->results().ToPacString()); | 730 EXPECT_EQ("DIRECT", request->results().ToPacString()); |
| 731 | 731 |
| 732 EXPECT_EQ(2, mojo_proxy_resolver_factory_.num_create_calls()); | 732 EXPECT_EQ(2, mojo_proxy_resolver_factory_.num_create_calls()); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace net | 735 } // namespace net |
| OLD | NEW |