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

Unified Diff: net/dns/host_resolver_impl_unittest.cc

Issue 2916903006: Change HostResolverImplDnsTest.NoIPv6OnWifi to no longer leak (Closed)
Patch Set: Cleanup Created 3 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 | « no previous file | no next file » | 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 4a963be528e2514707b8edce1c206a284433c17f..0869910bee28ea58c92dff4bf8dcd4f2a652efb1 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -2407,14 +2407,12 @@ TEST_F(HostResolverImplDnsTest, ManuallyDisableDnsClientWithPendingRequests) {
EXPECT_TRUE(requests_[2]->HasOneAddress("192.168.0.3", 80));
}
-// TODO(crbug.com/728808): This test causes HttpNetworkTransactionTests to crash
-// on iOS.
-#if defined(OS_IOS)
-#define MAYBE_NoIPv6OnWifi DISABLED_NoIPv6OnWifi
-#else
-#define MAYBE_NoIPv6OnWifi NoIPv6OnWifi
-#endif
-TEST_F(HostResolverImplDnsTest, MAYBE_NoIPv6OnWifi) {
+TEST_F(HostResolverImplDnsTest, NoIPv6OnWifi) {
+ // CreateSerialResolver will destroy the current resolver_ which will attempt
+ // to remove itself from the NetworkChangeNotifier. If this happens after a
+ // new NetworkChangeNotifier is active, then it will not remove itself from
+ // the old NetworkChangeNotifier which is a potential use-after-free.
+ resolver_ = nullptr;
test::ScopedMockNetworkChangeNotifier notifier;
CreateSerialResolver(); // To guarantee order of resolutions.
resolver_->SetNoIPv6OnWifi(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698