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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "mojo/public/cpp/bindings/binding.h" |
8 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
9 #include "net/proxy/mock_proxy_resolver.h" | 10 #include "net/proxy/mock_proxy_resolver.h" |
10 #include "net/proxy/proxy_resolver_v8_tracing.h" | 11 #include "net/proxy/proxy_resolver_v8_tracing.h" |
11 #include "net/test/event_waiter.h" | 12 #include "net/test/event_waiter.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 namespace { | 16 namespace { |
17 | 17 |
18 const char kScriptData[] = "FooBarBaz"; | 18 const char kScriptData[] = "FooBarBaz"; |
19 | 19 |
20 class FakeProxyResolver : public ProxyResolverV8Tracing { | 20 class FakeProxyResolver : public ProxyResolverV8Tracing { |
21 public: | 21 public: |
22 explicit FakeProxyResolver(const base::Closure& on_destruction) | 22 explicit FakeProxyResolver(const base::Closure& on_destruction) |
23 : on_destruction_(on_destruction) {} | 23 : on_destruction_(on_destruction) {} |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, | 207 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, |
208 base::Unretained(this))); | 208 base::Unretained(this))); |
209 waiter_.WaitForEvent(RESOLVER_CREATED); | 209 waiter_.WaitForEvent(RESOLVER_CREATED); |
210 EXPECT_EQ(0, instances_destroyed_); | 210 EXPECT_EQ(0, instances_destroyed_); |
211 ASSERT_EQ(1u, mock_factory_->requests_handled()); | 211 ASSERT_EQ(1u, mock_factory_->requests_handled()); |
212 factory_.reset(); | 212 factory_.reset(); |
213 waiter_.WaitForEvent(CONNECTION_ERROR); | 213 waiter_.WaitForEvent(CONNECTION_ERROR); |
214 } | 214 } |
215 | 215 |
216 } // namespace net | 216 } // namespace net |
OLD | NEW |