Index: content/public/test/browser_test_base.cc |
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc |
index 69afea661cdba13b2e7c856c143f02b931916293..c500db9eaa118e0a62ad98e03175dc03fc59801b 100644 |
--- a/content/public/test/browser_test_base.cc |
+++ b/content/public/test/browser_test_base.cc |
@@ -373,8 +373,20 @@ bool BrowserTestBase::UsingSoftwareGL() const { |
} |
void BrowserTestBase::InitializeNetworkProcess() { |
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableNetworkService)) |
+ const testing::TestInfo* const test_info = |
+ testing::UnitTest::GetInstance()->current_test_info(); |
+ bool network_service = base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableNetworkService); |
+ // ProcessTransferAfterError is the only browser test which needs to modify |
+ // the host rules (when not using the network service). |
+ if (network_service || |
+ std::string(test_info->name()) != "ProcessTransferAfterError") { |
+ // TODO(jam): enable this once all access to host_resolver() is in |
+ // SetUpOnMainThread or before. http://crbug.com/713847 |
+ // host_resolver()->DisableModifications(); |
+ } |
+ |
+ if (!network_service) |
return; |
net::RuleBasedHostResolverProc::RuleList rules = host_resolver()->GetRules(); |
@@ -401,10 +413,6 @@ void BrowserTestBase::InitializeNetworkProcess() { |
ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface( |
mojom::kNetworkServiceName, &network_service_test); |
network_service_test->AddRules(std::move(mojo_rules)); |
- |
- // TODO(jam): enable this once all access to host_resolver() is in |
- // SetUpOnMainThread or before. http://crbug.com/713847 |
- // host_resolver()->DisableModifications(); |
} |
} // namespace content |