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

Unified Diff: net/dns/dns_config_service_posix_unittest.cc

Issue 2136563002: Remove calls to MessageLoop::current() in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: net/dns/dns_config_service_posix_unittest.cc
diff --git a/net/dns/dns_config_service_posix_unittest.cc b/net/dns/dns_config_service_posix_unittest.cc
index 88448b16567a4250d3a8af01fc319010c070ddc5..30a3814cde94a04105ee61ab67993cd4e1cd1510 100644
--- a/net/dns/dns_config_service_posix_unittest.cc
+++ b/net/dns/dns_config_service_posix_unittest.cc
@@ -6,6 +6,7 @@
#include "base/cancelable_callback.h"
#include "base/files/file_util.h"
+#include "base/run_loop.h"
#include "base/sys_byteorder.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
@@ -207,7 +208,7 @@ class DnsConfigServicePosixTest : public testing::Test {
void OnConfigChanged(const DnsConfig& config) {
EXPECT_TRUE(config.IsValid());
seen_config_ = true;
- base::MessageLoop::current()->QuitWhenIdle();
+ run_loop_.QuitWhenIdle();
}
void WriteMockHostsFile(const char* hosts_string) {
@@ -266,7 +267,7 @@ class DnsConfigServicePosixTest : public testing::Test {
void ExpectChange() {
EXPECT_FALSE(seen_config_);
- base::MessageLoop::current()->Run();
+ run_loop_.Run();
EXPECT_TRUE(seen_config_);
seen_config_ = false;
}
@@ -276,6 +277,7 @@ class DnsConfigServicePosixTest : public testing::Test {
base::FilePath temp_file_;
std::unique_ptr<DnsConfigServicePosix> service_;
DnsConfig test_config_;
+ base::RunLoop run_loop_;
};
TEST_F(DnsConfigServicePosixTest, SeenChangeSinceNetworkChange) {

Powered by Google App Engine
This is Rietveld 408576698