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_factory_impl.h" | 5 #include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 explicit FakeProxyResolver(const base::Closure& on_destruction) | 24 explicit FakeProxyResolver(const base::Closure& on_destruction) |
25 : on_destruction_(on_destruction) {} | 25 : on_destruction_(on_destruction) {} |
26 | 26 |
27 ~FakeProxyResolver() override { on_destruction_.Run(); } | 27 ~FakeProxyResolver() override { on_destruction_.Run(); } |
28 | 28 |
29 private: | 29 private: |
30 // ProxyResolverV8Tracing overrides. | 30 // ProxyResolverV8Tracing overrides. |
31 void GetProxyForURL(const GURL& url, | 31 void GetProxyForURL(const GURL& url, |
32 ProxyInfo* results, | 32 ProxyInfo* results, |
33 const CompletionCallback& callback, | 33 const CompletionCallback& callback, |
34 scoped_ptr<ProxyResolver::Request>* request, | 34 ProxyResolver::RequestHandle* request, |
35 scoped_ptr<Bindings> bindings) override {} | 35 scoped_ptr<Bindings> bindings) override {} |
36 | 36 |
| 37 void CancelRequest(ProxyResolver::RequestHandle request) override {} |
| 38 |
| 39 LoadState GetLoadState(ProxyResolver::RequestHandle request) const override { |
| 40 return LOAD_STATE_RESOLVING_PROXY_FOR_URL; |
| 41 } |
| 42 |
37 const base::Closure on_destruction_; | 43 const base::Closure on_destruction_; |
38 }; | 44 }; |
39 | 45 |
40 enum Event { | 46 enum Event { |
41 NONE, | 47 NONE, |
42 RESOLVER_CREATED, | 48 RESOLVER_CREATED, |
43 CONNECTION_ERROR, | 49 CONNECTION_ERROR, |
44 RESOLVER_DESTROYED, | 50 RESOLVER_DESTROYED, |
45 }; | 51 }; |
46 | 52 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, | 213 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, |
208 base::Unretained(this))); | 214 base::Unretained(this))); |
209 waiter_.WaitForEvent(RESOLVER_CREATED); | 215 waiter_.WaitForEvent(RESOLVER_CREATED); |
210 EXPECT_EQ(0, instances_destroyed_); | 216 EXPECT_EQ(0, instances_destroyed_); |
211 ASSERT_EQ(1u, mock_factory_->requests_handled()); | 217 ASSERT_EQ(1u, mock_factory_->requests_handled()); |
212 factory_.reset(); | 218 factory_.reset(); |
213 waiter_.WaitForEvent(CONNECTION_ERROR); | 219 waiter_.WaitForEvent(CONNECTION_ERROR); |
214 } | 220 } |
215 | 221 |
216 } // namespace net | 222 } // namespace net |
OLD | NEW |