Index: chrome/browser/extensions/isolated_app_browsertest.cc |
diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc |
index 6dfe9e5dae9058e9aebbf049052eea3e41289a71..3c3733c7efe02dd9e449c1ba81c11cc7217ed074 100644 |
--- a/chrome/browser/extensions/isolated_app_browsertest.cc |
+++ b/chrome/browser/extensions/isolated_app_browsertest.cc |
@@ -104,6 +104,11 @@ std::unique_ptr<net::test_server::HttpResponse> HandleExpectAndSetCookieRequest( |
class IsolatedAppTest : public ExtensionBrowserTest { |
public: |
+ void SetUpOnMainThread() override { |
+ ExtensionBrowserTest::SetUpOnMainThread(); |
+ host_resolver()->AddRule("*", "127.0.0.1"); |
+ } |
+ |
// Returns whether the given tab's current URL has the given cookie. |
bool WARN_UNUSED_RESULT HasCookie(WebContents* contents, |
const std::string& cookie) { |
@@ -139,7 +144,6 @@ class IsolatedAppTest : public ExtensionBrowserTest { |
}; |
IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CrossProcessClientRedirect) { |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
@@ -202,7 +206,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CrossProcessClientRedirect) { |
// extent. These origins should also be isolated, but still have origin-based |
// separation as you would expect. |
IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
@@ -299,7 +302,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { |
// This test is disabled due to being flaky. http://crbug.com/145588 |
// Ensure that cookies are not isolated if the isolated apps are not installed. |
IN_PROC_BROWSER_TEST_F(IsolatedAppTest, DISABLED_NoCookieIsolationWithoutApp) { |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
// The app under test acts on URLs whose host is "localhost", |
@@ -380,7 +382,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_SubresourceCookieIsolation) { |
embedded_test_server()->RegisterRequestHandler( |
base::Bind(&HandleExpectAndSetCookieRequest, embedded_test_server())); |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
@@ -453,7 +454,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_SubresourceCookieIsolation) { |
// This is true even in the case of the OAuth workaround for hosted apps, |
// where non-app popups may be kept in the hosted app process. |
IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_IsolatedAppProcessModel) { |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
@@ -511,7 +511,6 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_IsolatedAppProcessModel) { |
// TODO(nasko): If isolated apps is no longer developed, this test should be |
// removed. http://crbug.com/159932 |
IN_PROC_BROWSER_TEST_F(IsolatedAppTest, DISABLED_SessionStorage) { |
- host_resolver()->AddRule("*", "127.0.0.1"); |
ASSERT_TRUE(embedded_test_server()->Start()); |
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |