| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 instances_destroyed_++; | 109 instances_destroyed_++; |
| 110 waiter_.NotifyEvent(RESOLVER_DESTROYED); | 110 waiter_.NotifyEvent(RESOLVER_DESTROYED); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ReportResult(int32_t error) override { create_callback_.Run(error); } | 113 void ReportResult(int32_t error) override { create_callback_.Run(error); } |
| 114 | 114 |
| 115 void Alert(const mojo::String& message) override {} | 115 void Alert(const mojo::String& message) override {} |
| 116 | 116 |
| 117 void OnError(int32_t line_number, const mojo::String& message) override {} | 117 void OnError(int32_t line_number, const mojo::String& message) override {} |
| 118 | 118 |
| 119 void ResolveDns(interfaces::HostResolverRequestInfoPtr request_info, | 119 void ResolveDns(std::unique_ptr<HostResolver::RequestInfo> request_info, |
| 120 interfaces::HostResolverRequestClientPtr client) override {} | 120 interfaces::HostResolverRequestClientPtr client) override {} |
| 121 | 121 |
| 122 protected: | 122 protected: |
| 123 std::unique_ptr<TestProxyResolverFactory> mock_factory_owner_; | 123 std::unique_ptr<TestProxyResolverFactory> mock_factory_owner_; |
| 124 TestProxyResolverFactory* mock_factory_; | 124 TestProxyResolverFactory* mock_factory_; |
| 125 interfaces::ProxyResolverFactoryPtr factory_; | 125 interfaces::ProxyResolverFactoryPtr factory_; |
| 126 | 126 |
| 127 int instances_destroyed_ = 0; | 127 int instances_destroyed_ = 0; |
| 128 CompletionCallback create_callback_; | 128 CompletionCallback create_callback_; |
| 129 | 129 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, | 214 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, |
| 215 base::Unretained(this))); | 215 base::Unretained(this))); |
| 216 waiter_.WaitForEvent(RESOLVER_CREATED); | 216 waiter_.WaitForEvent(RESOLVER_CREATED); |
| 217 EXPECT_EQ(0, instances_destroyed_); | 217 EXPECT_EQ(0, instances_destroyed_); |
| 218 ASSERT_EQ(1u, mock_factory_->requests_handled()); | 218 ASSERT_EQ(1u, mock_factory_->requests_handled()); |
| 219 factory_.reset(); | 219 factory_.reset(); |
| 220 waiter_.WaitForEvent(CONNECTION_ERROR); | 220 waiter_.WaitForEvent(CONNECTION_ERROR); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace net | 223 } // namespace net |
| OLD | NEW |