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

Unified Diff: net/dns/dns_config_service_posix_unittest.cc

Issue 1965553005: Async DNS: Don't watch hosts file on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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_config_service_posix.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 38c5cb6d586faa021674b737c58ca9644c7deefd..18a71176b84d33e56a3b87368021525b3e2b8245 100644
--- a/net/dns/dns_config_service_posix_unittest.cc
+++ b/net/dns/dns_config_service_posix_unittest.cc
@@ -193,7 +193,11 @@ TEST(DnsConfigServicePosixTest, DestroyWhileJobsWorking) {
namespace internal {
const char kTempHosts1[] = "127.0.0.1 localhost";
+// kTempHosts2 is only used by SeenChangeSinceHostsChange, which doesn't run
+// on Android.
+#if !defined(OS_ANDROID)
const char kTempHosts2[] = "127.0.0.2 localhost";
+#endif // !defined(OS_ANDROID)
class DnsConfigServicePosixTest : public testing::Test {
public:
@@ -274,7 +278,7 @@ class DnsConfigServicePosixTest : public testing::Test {
DnsConfig test_config_;
};
-TEST_F(DnsConfigServicePosixTest, SeenChangeSince) {
+TEST_F(DnsConfigServicePosixTest, SeenChangeSinceNetworkChange) {
// Verify SeenChangeSince() returns false if no changes
StartWatching();
EXPECT_FALSE(service_->SeenChangeSince(creation_time_));
@@ -283,12 +287,6 @@ TEST_F(DnsConfigServicePosixTest, SeenChangeSince) {
service_->OnNetworkChanged(NetworkChangeNotifier::CONNECTION_WIFI);
EXPECT_TRUE(service_->SeenChangeSince(creation_time_));
ExpectChange();
- // Verify SeenChangeSince() returns true if hosts file changes
- StartWatching();
- EXPECT_FALSE(service_->SeenChangeSince(creation_time_));
- WriteMockHostsFile(kTempHosts2);
- EXPECT_TRUE(service_->SeenChangeSince(creation_time_));
- ExpectChange();
}
} // namespace internal
« no previous file with comments | « net/dns/dns_config_service_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698