| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 case GetProxyForUrlAction::WAIT_FOR_CLIENT_DISCONNECT: | 226 case GetProxyForUrlAction::WAIT_FOR_CLIENT_DISCONNECT: |
| 227 ASSERT_FALSE(client.WaitForIncomingMethodCall()); | 227 ASSERT_FALSE(client.WaitForIncomingMethodCall()); |
| 228 break; | 228 break; |
| 229 } | 229 } |
| 230 WakeWaiter(); | 230 WakeWaiter(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory { | 233 class TestMojoProxyResolverFactory : public MojoProxyResolverFactory { |
| 234 public: | 234 public: |
| 235 TestMojoProxyResolverFactory(); | 235 TestMojoProxyResolverFactory(); |
| 236 ~TestMojoProxyResolverFactory(); | 236 ~TestMojoProxyResolverFactory() override; |
| 237 | 237 |
| 238 // Overridden from MojoProxyResolverFactory: | 238 // Overridden from MojoProxyResolverFactory: |
| 239 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req, | 239 void Create(mojo::InterfaceRequest<interfaces::ProxyResolver> req, |
| 240 interfaces::HostResolverPtr host_resolver) override; | 240 interfaces::HostResolverPtr host_resolver) override; |
| 241 | 241 |
| 242 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; } | 242 MockMojoProxyResolver& GetMockResolver() { return *mock_proxy_resolver_; } |
| 243 | 243 |
| 244 void AddFuturePacScriptAction(int creation, SetPacScriptAction action); | 244 void AddFuturePacScriptAction(int creation, SetPacScriptAction action); |
| 245 void AddFutureGetProxyAction(int creation, GetProxyForUrlAction action); | 245 void AddFutureGetProxyAction(int creation, GetProxyForUrlAction action); |
| 246 | 246 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 // resolve request. | 688 // resolve request. |
| 689 scoped_ptr<Request> request(MakeRequest(GURL(kExampleUrl))); | 689 scoped_ptr<Request> request(MakeRequest(GURL(kExampleUrl))); |
| 690 EXPECT_EQ(ERR_IO_PENDING, request->Resolve()); | 690 EXPECT_EQ(ERR_IO_PENDING, request->Resolve()); |
| 691 EXPECT_EQ(OK, request->WaitForResult()); | 691 EXPECT_EQ(OK, request->WaitForResult()); |
| 692 EXPECT_EQ("DIRECT", request->results().ToPacString()); | 692 EXPECT_EQ("DIRECT", request->results().ToPacString()); |
| 693 | 693 |
| 694 EXPECT_EQ(2, mojo_proxy_resolver_factory_.num_create_calls()); | 694 EXPECT_EQ(2, mojo_proxy_resolver_factory_.num_create_calls()); |
| 695 } | 695 } |
| 696 | 696 |
| 697 } // namespace net | 697 } // namespace net |
| OLD | NEW |