| 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());
|
| }
|
|
|