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/mojo_proxy_resolver_impl.h" | 5 #include "net/proxy/mojo_proxy_resolver_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" |
11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
12 #include "net/proxy/mock_proxy_resolver.h" | 13 #include "net/proxy/mock_proxy_resolver.h" |
13 #include "net/proxy/mojo_proxy_type_converters.h" | 14 #include "net/proxy/mojo_proxy_type_converters.h" |
14 #include "net/proxy/proxy_info.h" | 15 #include "net/proxy/proxy_info.h" |
15 #include "net/proxy/proxy_resolver_v8_tracing.h" | 16 #include "net/proxy/proxy_resolver_v8_tracing.h" |
16 #include "net/proxy/proxy_server.h" | 17 #include "net/proxy/proxy_server.h" |
17 #include "net/test/event_waiter.h" | 18 #include "net/test/event_waiter.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 namespace { | 22 namespace { |
23 | 23 |
24 class TestRequestClient : public interfaces::ProxyResolverRequestClient { | 24 class TestRequestClient : public interfaces::ProxyResolverRequestClient { |
25 public: | 25 public: |
26 enum Event { | 26 enum Event { |
27 RESULT_RECEIVED, | 27 RESULT_RECEIVED, |
28 CONNECTION_ERROR, | 28 CONNECTION_ERROR, |
29 }; | 29 }; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 interfaces::ProxyResolverRequestClientPtr client_ptr; | 312 interfaces::ProxyResolverRequestClientPtr client_ptr; |
313 TestRequestClient client(mojo::GetProxy(&client_ptr)); | 313 TestRequestClient client(mojo::GetProxy(&client_ptr)); |
314 | 314 |
315 resolver_->GetProxyForUrl("http://example.com", client_ptr.Pass()); | 315 resolver_->GetProxyForUrl("http://example.com", client_ptr.Pass()); |
316 ASSERT_EQ(1u, mock_proxy_resolver_->pending_requests().size()); | 316 ASSERT_EQ(1u, mock_proxy_resolver_->pending_requests().size()); |
317 resolver_impl_.reset(); | 317 resolver_impl_.reset(); |
318 client.event_waiter().WaitForEvent(TestRequestClient::CONNECTION_ERROR); | 318 client.event_waiter().WaitForEvent(TestRequestClient::CONNECTION_ERROR); |
319 } | 319 } |
320 | 320 |
321 } // namespace net | 321 } // namespace net |
OLD | NEW |