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

Unified Diff: net/dns/dns_config_service_posix_unittest.cc

Issue 2315873002: Remove calls to deprecated MessageLoop methods in net. (Closed)
Patch Set: fix test error Created 4 years, 3 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/android/network_change_notifier_android_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c1ade5308049d9a4cb6fb6604920ff3dbd044bcc..35fcbab3500040aa45c7526d1af6708c6136ac09 100644
--- a/net/dns/dns_config_service_posix_unittest.cc
+++ b/net/dns/dns_config_service_posix_unittest.cc
@@ -4,9 +4,12 @@
#include <resolv.h>
+#include <memory>
+
#include "base/cancelable_callback.h"
#include "base/files/file_util.h"
-#include "base/message_loop/message_loop.h"
+#include "base/memory/ptr_util.h"
+#include "base/run_loop.h"
#include "base/sys_byteorder.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
@@ -208,7 +211,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) {
@@ -267,7 +270,8 @@ class DnsConfigServicePosixTest : public testing::Test {
void ExpectChange() {
EXPECT_FALSE(seen_config_);
- base::MessageLoop::current()->Run();
+ run_loop_ = base::MakeUnique<base::RunLoop>();
+ run_loop_->Run();
EXPECT_TRUE(seen_config_);
seen_config_ = false;
}
@@ -277,6 +281,7 @@ class DnsConfigServicePosixTest : public testing::Test {
base::FilePath temp_file_;
std::unique_ptr<DnsConfigServicePosix> service_;
DnsConfig test_config_;
+ std::unique_ptr<base::RunLoop> run_loop_;
};
TEST_F(DnsConfigServicePosixTest, SeenChangeSinceNetworkChange) {
« no previous file with comments | « net/android/network_change_notifier_android_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698