Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc

Issue 2299963002: Reland "Change ProxyResolver::GetProxyForURL() to take a unique_ptr<Request>* " (Closed)
Patch Set: remove fields proposed by eroman Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/proxy/mock_proxy_resolver.cc ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 explicit FakeProxyResolver(const base::Closure& on_destruction) 31 explicit FakeProxyResolver(const base::Closure& on_destruction)
32 : on_destruction_(on_destruction) {} 32 : on_destruction_(on_destruction) {}
33 33
34 ~FakeProxyResolver() override { on_destruction_.Run(); } 34 ~FakeProxyResolver() override { on_destruction_.Run(); }
35 35
36 private: 36 private:
37 // ProxyResolverV8Tracing overrides. 37 // ProxyResolverV8Tracing overrides.
38 void GetProxyForURL(const GURL& url, 38 void GetProxyForURL(const GURL& url,
39 ProxyInfo* results, 39 ProxyInfo* results,
40 const CompletionCallback& callback, 40 const CompletionCallback& callback,
41 ProxyResolver::RequestHandle* request, 41 std::unique_ptr<ProxyResolver::Request>* request,
42 std::unique_ptr<Bindings> bindings) override {} 42 std::unique_ptr<Bindings> bindings) override {}
43 43
44 void CancelRequest(ProxyResolver::RequestHandle request) override {}
45
46 LoadState GetLoadState(ProxyResolver::RequestHandle request) const override {
47 return LOAD_STATE_RESOLVING_PROXY_FOR_URL;
48 }
49
50 const base::Closure on_destruction_; 44 const base::Closure on_destruction_;
51 }; 45 };
52 46
53 enum Event { 47 enum Event {
54 NONE, 48 NONE,
55 RESOLVER_CREATED, 49 RESOLVER_CREATED,
56 CONNECTION_ERROR, 50 CONNECTION_ERROR,
57 RESOLVER_DESTROYED, 51 RESOLVER_DESTROYED,
58 }; 52 };
59 53
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, 211 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError,
218 base::Unretained(this))); 212 base::Unretained(this)));
219 waiter_.WaitForEvent(RESOLVER_CREATED); 213 waiter_.WaitForEvent(RESOLVER_CREATED);
220 EXPECT_EQ(0, instances_destroyed_); 214 EXPECT_EQ(0, instances_destroyed_);
221 ASSERT_EQ(1u, mock_factory_->requests_handled()); 215 ASSERT_EQ(1u, mock_factory_->requests_handled());
222 factory_.reset(); 216 factory_.reset();
223 waiter_.WaitForEvent(CONNECTION_ERROR); 217 waiter_.WaitForEvent(CONNECTION_ERROR);
224 } 218 }
225 219
226 } // namespace net 220 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/mock_proxy_resolver.cc ('k') | net/proxy/mojo_proxy_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698