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

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

Issue 1398973003: Don't use base::MessageLoop::{Quit,QuitClosure} in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/disk_cache/disk_cache_test_util.cc ('k') | net/dns/dns_config_service_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <resolv.h> 5 #include <resolv.h>
6 6
7 #include "base/cancelable_callback.h" 7 #include "base/cancelable_callback.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/sys_byteorder.h" 9 #include "base/sys_byteorder.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 const char kTempHosts2[] = "127.0.0.2 localhost"; 174 const char kTempHosts2[] = "127.0.0.2 localhost";
175 175
176 class DnsConfigServicePosixTest : public testing::Test { 176 class DnsConfigServicePosixTest : public testing::Test {
177 public: 177 public:
178 DnsConfigServicePosixTest() : seen_config_(false) {} 178 DnsConfigServicePosixTest() : seen_config_(false) {}
179 ~DnsConfigServicePosixTest() override {} 179 ~DnsConfigServicePosixTest() override {}
180 180
181 void OnConfigChanged(const DnsConfig& config) { 181 void OnConfigChanged(const DnsConfig& config) {
182 EXPECT_TRUE(config.IsValid()); 182 EXPECT_TRUE(config.IsValid());
183 seen_config_ = true; 183 seen_config_ = true;
184 base::MessageLoop::current()->Quit(); 184 base::MessageLoop::current()->QuitWhenIdle();
185 } 185 }
186 186
187 void WriteMockHostsFile(const char* hosts_string) { 187 void WriteMockHostsFile(const char* hosts_string) {
188 ASSERT_EQ(base::WriteFile(temp_file_, hosts_string, strlen(hosts_string)), 188 ASSERT_EQ(base::WriteFile(temp_file_, hosts_string, strlen(hosts_string)),
189 static_cast<int>(strlen(hosts_string))); 189 static_cast<int>(strlen(hosts_string)));
190 } 190 }
191 191
192 void MockDNSConfig(const char* dns_server) { 192 void MockDNSConfig(const char* dns_server) {
193 IPAddressNumber dns_number; 193 IPAddressNumber dns_number;
194 ASSERT_TRUE(ParseIPLiteralToNumber(dns_server, &dns_number)); 194 ASSERT_TRUE(ParseIPLiteralToNumber(dns_server, &dns_number));
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 WriteMockHostsFile(kTempHosts2); 263 WriteMockHostsFile(kTempHosts2);
264 EXPECT_TRUE(service_->SeenChangeSince(creation_time_)); 264 EXPECT_TRUE(service_->SeenChangeSince(creation_time_));
265 ExpectChange(); 265 ExpectChange();
266 } 266 }
267 267
268 } // namespace internal 268 } // namespace internal
269 269
270 #endif // OS_ANDROID 270 #endif // OS_ANDROID
271 271
272 } // namespace net 272 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_util.cc ('k') | net/dns/dns_config_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698