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

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

Issue 1439053002: Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore scoped_ptr to mock and nits Created 4 years, 10 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/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
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 ProxyResolver::RequestHandle* request, 34 scoped_ptr<ProxyResolver::Request>* 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
43 const base::Closure on_destruction_; 37 const base::Closure on_destruction_;
44 }; 38 };
45 39
46 enum Event { 40 enum Event {
47 NONE, 41 NONE,
48 RESOLVER_CREATED, 42 RESOLVER_CREATED,
49 CONNECTION_ERROR, 43 CONNECTION_ERROR,
50 RESOLVER_DESTROYED, 44 RESOLVER_DESTROYED,
51 }; 45 };
52 46
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, 207 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError,
214 base::Unretained(this))); 208 base::Unretained(this)));
215 waiter_.WaitForEvent(RESOLVER_CREATED); 209 waiter_.WaitForEvent(RESOLVER_CREATED);
216 EXPECT_EQ(0, instances_destroyed_); 210 EXPECT_EQ(0, instances_destroyed_);
217 ASSERT_EQ(1u, mock_factory_->requests_handled()); 211 ASSERT_EQ(1u, mock_factory_->requests_handled());
218 factory_.reset(); 212 factory_.reset();
219 waiter_.WaitForEvent(CONNECTION_ERROR); 213 waiter_.WaitForEvent(CONNECTION_ERROR);
220 } 214 }
221 215
222 } // namespace net 216 } // 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