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

Side by Side Diff: chrome/common/local_discovery/local_domain_resolver_unittest.cc

Issue 1167163002: chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing message_loop.h includes. Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/location.h"
6 #include "base/single_thread_task_runner.h"
7 #include "base/thread_task_runner_handle.h"
5 #include "chrome/common/local_discovery/service_discovery_client_impl.h" 8 #include "chrome/common/local_discovery/service_discovery_client_impl.h"
6 #include "net/dns/mdns_client_impl.h" 9 #include "net/dns/mdns_client_impl.h"
7 #include "net/dns/mock_mdns_socket_factory.h" 10 #include "net/dns/mock_mdns_socket_factory.h"
8 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
10 13
11 using ::testing::_; 14 using ::testing::_;
12 15
13 namespace local_discovery { 16 namespace local_discovery {
14 17
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const net::IPAddressNumber& address_ipv6) { 77 const net::IPAddressNumber& address_ipv6) {
75 AddressCallbackInternal(resolved, 78 AddressCallbackInternal(resolved,
76 IPAddressToStringWithEmpty(address_ipv4), 79 IPAddressToStringWithEmpty(address_ipv4),
77 IPAddressToStringWithEmpty(address_ipv6)); 80 IPAddressToStringWithEmpty(address_ipv6));
78 } 81 }
79 82
80 void RunFor(base::TimeDelta time_period) { 83 void RunFor(base::TimeDelta time_period) {
81 base::CancelableCallback<void()> callback(base::Bind( 84 base::CancelableCallback<void()> callback(base::Bind(
82 &base::MessageLoop::Quit, 85 &base::MessageLoop::Quit,
83 base::Unretained(base::MessageLoop::current()))); 86 base::Unretained(base::MessageLoop::current())));
84 base::MessageLoop::current()->PostDelayedTask( 87 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
85 FROM_HERE, callback.callback(), time_period); 88 FROM_HERE, callback.callback(), time_period);
86 89
87 base::MessageLoop::current()->Run(); 90 base::MessageLoop::current()->Run();
88 callback.Cancel(); 91 callback.Cancel();
89 } 92 }
90 93
91 MOCK_METHOD3(AddressCallbackInternal, 94 MOCK_METHOD3(AddressCallbackInternal,
92 void(bool resolved, 95 void(bool resolved,
93 std::string address_ipv4, 96 std::string address_ipv4,
94 std::string address_ipv6)); 97 std::string address_ipv6));
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 resolver.Start(); 177 resolver.Start();
175 178
176 EXPECT_CALL(*this, AddressCallbackInternal(false, "", "")); 179 EXPECT_CALL(*this, AddressCallbackInternal(false, "", ""));
177 180
178 RunFor(base::TimeDelta::FromSeconds(4)); 181 RunFor(base::TimeDelta::FromSeconds(4));
179 } 182 }
180 183
181 } // namespace 184 } // namespace
182 185
183 } // namespace local_discovery 186 } // namespace local_discovery
OLDNEW
« no previous file with comments | « chrome/app_shim/chrome_main_app_mode_mac.mm ('k') | chrome/common/local_discovery/service_discovery_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698