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

Side by Side Diff: net/dns/mojo_host_resolver_impl_unittest.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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/dns/host_resolver_mojo_unittest.cc ('k') | net/dns/mojo_host_type_converters.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/dns/mojo_host_resolver_impl.h" 5 #include "net/dns/mojo_host_resolver_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 new MojoHostResolverImpl(&mock_host_resolver_, BoundNetLog())); 136 new MojoHostResolverImpl(&mock_host_resolver_, BoundNetLog()));
137 } 137 }
138 138
139 interfaces::HostResolverRequestInfoPtr CreateRequest(const std::string& host, 139 interfaces::HostResolverRequestInfoPtr CreateRequest(const std::string& host,
140 uint16_t port, 140 uint16_t port,
141 bool is_my_ip_address) { 141 bool is_my_ip_address) {
142 interfaces::HostResolverRequestInfoPtr request = 142 interfaces::HostResolverRequestInfoPtr request =
143 interfaces::HostResolverRequestInfo::New(); 143 interfaces::HostResolverRequestInfo::New();
144 request->host = host; 144 request->host = host;
145 request->port = port; 145 request->port = port;
146 request->address_family = interfaces::ADDRESS_FAMILY_IPV4; 146 request->address_family = interfaces::AddressFamily::IPV4;
147 request->is_my_ip_address = is_my_ip_address; 147 request->is_my_ip_address = is_my_ip_address;
148 return request; 148 return request;
149 } 149 }
150 150
151 // Wait until the mock resolver has received |num| resolve requests. 151 // Wait until the mock resolver has received |num| resolve requests.
152 void WaitForRequests(size_t num) { 152 void WaitForRequests(size_t num) {
153 while (mock_host_resolver_.num_resolve() < num) { 153 while (mock_host_resolver_.num_resolve() < num) {
154 base::RunLoop run_loop; 154 base::RunLoop run_loop;
155 mock_host_resolver_.SetResolveCallback(run_loop.QuitClosure()); 155 mock_host_resolver_.SetResolveCallback(run_loop.QuitClosure());
156 run_loop.Run(); 156 run_loop.Run();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 WaitForRequests(1); 279 WaitForRequests(1);
280 280
281 client.reset(); 281 client.reset();
282 base::RunLoop().RunUntilIdle(); 282 base::RunLoop().RunUntilIdle();
283 283
284 mock_host_resolver_.ResolveAllPending(); 284 mock_host_resolver_.ResolveAllPending();
285 base::RunLoop().RunUntilIdle(); 285 base::RunLoop().RunUntilIdle();
286 } 286 }
287 287
288 } // namespace net 288 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_mojo_unittest.cc ('k') | net/dns/mojo_host_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698