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

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: Created 5 years, 1 month 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
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 "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "net/base/test_completion_callback.h" 8 #include "net/base/test_completion_callback.h"
9 #include "net/proxy/mock_proxy_resolver.h" 9 #include "net/proxy/mock_proxy_resolver.h"
10 #include "net/proxy/proxy_resolver_v8_tracing.h" 10 #include "net/proxy/proxy_resolver_v8_tracing.h"
(...skipping 11 matching lines...) Expand all
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) {}
24 24
25 ~FakeProxyResolver() override { on_destruction_.Run(); } 25 ~FakeProxyResolver() override { on_destruction_.Run(); }
26 26
27 private: 27 private:
28 // ProxyResolverV8Tracing overrides. 28 // ProxyResolverV8Tracing overrides.
29 void GetProxyForURL(const GURL& url, 29 void GetProxyForURL(const GURL& url,
30 ProxyInfo* results, 30 ProxyInfo* results,
31 const CompletionCallback& callback, 31 const CompletionCallback& callback,
32 ProxyResolver::RequestHandle* request, 32 scoped_ptr<ProxyResolver::Request>* request,
33 scoped_ptr<Bindings> bindings) override {} 33 scoped_ptr<Bindings> bindings) override {}
34 34
35 void CancelRequest(ProxyResolver::RequestHandle request) override {}
36
37 LoadState GetLoadState(ProxyResolver::RequestHandle request) const override {
38 return LOAD_STATE_RESOLVING_PROXY_FOR_URL;
39 }
40
41 const base::Closure on_destruction_; 35 const base::Closure on_destruction_;
42 }; 36 };
43 37
44 enum Event { 38 enum Event {
45 NONE, 39 NONE,
46 RESOLVER_CREATED, 40 RESOLVER_CREATED,
47 CONNECTION_ERROR, 41 CONNECTION_ERROR,
48 RESOLVER_DESTROYED, 42 RESOLVER_DESTROYED,
49 }; 43 };
50 44
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError, 201 base::Bind(&MojoProxyResolverFactoryImplTest::OnConnectionError,
208 base::Unretained(this))); 202 base::Unretained(this)));
209 waiter_.WaitForEvent(RESOLVER_CREATED); 203 waiter_.WaitForEvent(RESOLVER_CREATED);
210 EXPECT_EQ(0, instances_destroyed_); 204 EXPECT_EQ(0, instances_destroyed_);
211 ASSERT_EQ(1u, mock_factory_->requests_handled()); 205 ASSERT_EQ(1u, mock_factory_->requests_handled());
212 factory_.reset(); 206 factory_.reset();
213 waiter_.WaitForEvent(CONNECTION_ERROR); 207 waiter_.WaitForEvent(CONNECTION_ERROR);
214 } 208 }
215 209
216 } // namespace net 210 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698