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

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

Issue 1145153004: Split ProxyResolverV8Tracing into an implementation and a wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/mojo_proxy_resolver_factory_impl.cc ('k') | net/proxy/mojo_proxy_resolver_impl.h » ('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 "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_error_observer.h" 10 #include "net/proxy/proxy_resolver_error_observer.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::Unretained(this)), 69 base::Unretained(this)),
70 mojo::GetProxy(&factory_)); 70 mojo::GetProxy(&factory_));
71 mock_factory_owner_.reset(new TestProxyResolverFactory(&waiter_)); 71 mock_factory_owner_.reset(new TestProxyResolverFactory(&waiter_));
72 mock_factory_ = mock_factory_owner_.get(); 72 mock_factory_ = mock_factory_owner_.get();
73 } 73 }
74 74
75 void OnConnectionError() override { waiter_.NotifyEvent(CONNECTION_ERROR); } 75 void OnConnectionError() override { waiter_.NotifyEvent(CONNECTION_ERROR); }
76 76
77 scoped_ptr<ProxyResolverFactory> CreateFakeProxyResolverFactory( 77 scoped_ptr<ProxyResolverFactory> CreateFakeProxyResolverFactory(
78 HostResolver* host_resolver, 78 HostResolver* host_resolver,
79 scoped_ptr<ProxyResolverErrorObserver> error_observer, 79 scoped_ptr<ProxyResolverErrorObserver> error_observer) {
80 const ProxyResolver::LoadStateChangedCallback& callback) {
81 EXPECT_TRUE(host_resolver); 80 EXPECT_TRUE(host_resolver);
82 EXPECT_FALSE(callback.is_null());
83 DCHECK(mock_factory_owner_); 81 DCHECK(mock_factory_owner_);
84 return mock_factory_owner_.Pass(); 82 return mock_factory_owner_.Pass();
85 } 83 }
86 84
87 void OnFakeProxyInstanceDestroyed() { 85 void OnFakeProxyInstanceDestroyed() {
88 instances_destroyed_++; 86 instances_destroyed_++;
89 waiter_.NotifyEvent(RESOLVER_DESTROYED); 87 waiter_.NotifyEvent(RESOLVER_DESTROYED);
90 } 88 }
91 89
92 void ReportResult(int32_t error) override { create_callback_.Run(error); } 90 void ReportResult(int32_t error) override { create_callback_.Run(error); }
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 waiter_.WaitForEvent(RESOLVER_CREATED); 296 waiter_.WaitForEvent(RESOLVER_CREATED);
299 EXPECT_EQ(0, instances_destroyed_); 297 EXPECT_EQ(0, instances_destroyed_);
300 ASSERT_EQ(1u, mock_factory_->pending_requests().size()); 298 ASSERT_EQ(1u, mock_factory_->pending_requests().size());
301 EXPECT_EQ(base::ASCIIToUTF16(kScriptData), 299 EXPECT_EQ(base::ASCIIToUTF16(kScriptData),
302 mock_factory_->pending_requests()[0]->script_data()->utf16()); 300 mock_factory_->pending_requests()[0]->script_data()->utf16());
303 factory_.reset(); 301 factory_.reset();
304 waiter_.WaitForEvent(CONNECTION_ERROR); 302 waiter_.WaitForEvent(CONNECTION_ERROR);
305 } 303 }
306 304
307 } // namespace net 305 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/mojo_proxy_resolver_factory_impl.cc ('k') | net/proxy/mojo_proxy_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698