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

Unified Diff: net/dns/host_resolver_impl_unittest.cc

Issue 2090613002: Remove calls to deprecated MessageLoop methods in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/dns/serial_worker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl_unittest.cc
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index 210b36dfdc0773c2c980320fb8d40006a96dca4c..b89db66b4ff6b02f66e35c1b686f9b34bd1ef232 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -294,7 +294,7 @@ class Request {
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, closure.callback(), TestTimeouts::action_max_timeout());
quit_on_complete_ = true;
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
bool did_quit = !quit_on_complete_;
quit_on_complete_ = false;
closure.Cancel();
@@ -932,7 +932,7 @@ TEST_F(HostResolverImplTest, DeleteWithinCallback) {
proc_->SignalMultiple(1u); // One for "a".
// |MyHandler| will send quit message once all the requests have finished.
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
}
TEST_F(HostResolverImplTest, DeleteWithinAbortedCallback) {
@@ -965,7 +965,7 @@ TEST_F(HostResolverImplTest, DeleteWithinAbortedCallback) {
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
// |MyHandler| will send quit message once all the requests have finished.
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_EQ(ERR_NETWORK_CHANGED, requests_[0]->result());
EXPECT_EQ(ERR_IO_PENDING, requests_[1]->result());
@@ -1036,7 +1036,7 @@ TEST_F(HostResolverImplTest, BypassCache) {
proc_->SignalMultiple(3u); // Only need two, but be generous.
// |verifier| will send quit message once all the requests have finished.
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
EXPECT_EQ(2u, proc_->GetCaptureList().size());
}
@@ -1059,7 +1059,7 @@ TEST_F(HostResolverImplTest, FlushCacheOnIPAddressChange) {
// Flush cache by triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
// Resolve "host1" again -- this time it won't be served from cache, so it
// will complete asynchronously.
@@ -1076,7 +1076,7 @@ TEST_F(HostResolverImplTest, AbortOnIPAddressChanged) {
EXPECT_TRUE(proc_->WaitFor(1u));
// Triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
proc_->SignalAll();
EXPECT_EQ(ERR_NETWORK_CHANGED, req->WaitForResult());
@@ -1091,7 +1091,7 @@ TEST_F(HostResolverImplTest, DontAbortOnInitialDNSConfigRead) {
EXPECT_TRUE(proc_->WaitFor(1u));
// Triggering initial DNS config read signal.
NetworkChangeNotifier::NotifyObserversOfInitialDNSConfigReadForTests();
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
proc_->SignalAll();
EXPECT_EQ(OK, req->WaitForResult());
@@ -1108,7 +1108,7 @@ TEST_F(HostResolverImplTest, ObeyPoolConstraintsAfterIPAddressChange) {
EXPECT_TRUE(proc_->WaitFor(1u));
// Triggering an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
proc_->SignalMultiple(3u); // Let the false-start go so that we can catch it.
EXPECT_EQ(ERR_NETWORK_CHANGED, requests_[0]->WaitForResult());
@@ -1152,7 +1152,7 @@ TEST_F(HostResolverImplTest, AbortOnlyExistingRequestsOnIPAddressChange) {
// Trigger an IP address change.
NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
// This should abort all running jobs.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(ERR_NETWORK_CHANGED, requests_[0]->result());
EXPECT_EQ(ERR_NETWORK_CHANGED, requests_[1]->result());
EXPECT_EQ(ERR_NETWORK_CHANGED, requests_[2]->result());
@@ -1458,7 +1458,7 @@ TEST_F(HostResolverImplTest, MultipleAttempts) {
resolver_proc->WaitForAllAttemptsToFinish(
base::TimeDelta::FromMilliseconds(60000));
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(resolver_proc->total_attempts_resolved(), kTotalAttempts);
EXPECT_EQ(resolver_proc->resolved_attempt_number(), kAttemptNumberToResolve);
@@ -1619,7 +1619,7 @@ class HostResolverImplDnsTest : public HostResolverImplTest {
void ChangeDnsConfig(const DnsConfig& config) {
NetworkChangeNotifier::SetDnsConfig(config);
// Notification is delivered asynchronously.
- base::MessageLoop::current()->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
MockDnsClientRuleList dns_rules_;
@@ -1724,7 +1724,7 @@ TEST_F(HostResolverImplDnsTest, OnDnsTaskFailureAbortedJob) {
CreateResolver();
proc_->SignalMultiple(requests_.size());
// Run to completion.
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
// It shouldn't crash during OnDnsTaskFailure callbacks.
EXPECT_EQ(ERR_IO_PENDING, requests_[0]->result());
@@ -1735,7 +1735,7 @@ TEST_F(HostResolverImplDnsTest, OnDnsTaskFailureAbortedJob) {
// Abort all jobs here.
CreateResolver();
// Run to completion.
- base::MessageLoop::current()->RunUntilIdle(); // Notification happens async.
+ base::RunLoop().RunUntilIdle(); // Notification happens async.
// It shouldn't crash during OnDnsTaskFailure callbacks.
EXPECT_EQ(ERR_IO_PENDING, requests_[1]->result());
}
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/dns/serial_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698