Commit 1df5d87d authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Reduce the number of browser_tests excluded in site-per-process mode.

The following tests have mysteriously "healed" themselves and seem to be
passing now:
- IsolatedAppTest.CookieIsolation
- ChromeRenderProcessHostTest.ProcessOverflow
- ChromeRenderProcessHostTest.ProcessPerTab
- ChromeRenderProcessHostTestWithCommandLine.ProcessOverflowCommandLine

The following tests simply needs to adjust their expectations in
site-per-process mode:
- ProcessManagementTest.ExtensionProcessBalancing
- ProcessManagementTest.ProcessOverflow

The following tests no longer exist:
- PrerenderBrowserTest.PrerenderLocationReplaceGWSHistograms

Bug: 671712, 417518
Change-Id: I5fc805da62f468f76ee7091edede8b0b76a5fd0f
Reviewed-on: https://chromium-review.googlesource.com/942103
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540398}
parent 1ccb08d5
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h" #include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_host.h" #include "extensions/browser/extension_host.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h" #include "extensions/browser/process_map.h"
...@@ -267,8 +268,14 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ProcessOverflow) { ...@@ -267,8 +268,14 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ProcessOverflow) {
EXPECT_EQ(web1_host, web2_host); EXPECT_EQ(web1_host, web2_host);
EXPECT_NE(web1_host, extension1_host); EXPECT_NE(web1_host, extension1_host);
// Extensions only share with each other. if (!content::AreAllSitesIsolatedForTesting()) {
EXPECT_EQ(extension1_host, extension2_host); // Extensions only share with each other ...
EXPECT_EQ(extension1_host, extension2_host);
} else {
// ... unless site-per-process is enabled - in this case no sharing
// is possible.
EXPECT_NE(extension1_host, extension2_host);
}
} }
// See // See
...@@ -309,9 +316,12 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ExtensionProcessBalancing) { ...@@ -309,9 +316,12 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ExtensionProcessBalancing) {
ASSERT_TRUE(LoadExtension( ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("api_test/management/test"))); test_data_dir_.AppendASCII("api_test/management/test")));
// TODO(lukasza): It might be worth it to navigate to actual
// chrome-extension:// URIs below (not to HTTP URIs) to make sure the 1/3rd
// of process limit also applies to normal tabs (not just to background pages
// and scripts).
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
browser(), base_url.Resolve("isolated_apps/app1/main.html")); browser(), base_url.Resolve("isolated_apps/app1/main.html"));
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
browser(), base_url.Resolve("api_test/management/test/basics.html")); browser(), base_url.Resolve("api_test/management/test/basics.html"));
...@@ -321,13 +331,27 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ExtensionProcessBalancing) { ...@@ -321,13 +331,27 @@ IN_PROC_BROWSER_TEST_F(ProcessManagementTest, MAYBE_ExtensionProcessBalancing) {
for (extensions::ExtensionHost* host : epm->background_hosts()) for (extensions::ExtensionHost* host : epm->background_hosts())
process_ids.insert(host->render_process_host()->GetID()); process_ids.insert(host->render_process_host()->GetID());
// We've loaded 5 extensions with background pages, 1 extension without // We've loaded 5 extensions with background pages
// background page, and one isolated app. We expect only 2 unique processes // (api_test/browser_action/*), 1 extension without background page
// hosting those extensions. // (api_test/management), and one isolated app. We expect only 2 unique
// processes hosting the background pages/scripts of these extensions without
// site-per-process (which extension gets assigned to which process is
// randomized). With site-per-process (which is not subject to the 1/3rd of
// process limit cap) each of the 5 background pages/scripts will be hosted in
// a separate process.
if (!content::AreAllSitesIsolatedForTesting())
EXPECT_EQ(2u, process_ids.size());
else
EXPECT_EQ(5u, process_ids.size());
// ProcessMap will always have exactly 5 entries - one for each of the
// extensions with a background page (api_test/browser_action/*). There won't
// be any additional entries, since 1) the isolated app will be associated
// with a separate content::BrowserContext and 2) the navigation to
// api_test/management/test/basics.html navigates to a file: URI (not to a
// chrome-extension: URI).
extensions::ProcessMap* process_map = extensions::ProcessMap::Get(profile); extensions::ProcessMap* process_map = extensions::ProcessMap::Get(profile);
EXPECT_EQ(5u, process_map->size());
EXPECT_GE((size_t) 6, process_map->size());
EXPECT_EQ((size_t) 2, process_ids.size());
} }
IN_PROC_BROWSER_TEST_F(ProcessManagementTest, IN_PROC_BROWSER_TEST_F(ProcessManagementTest,
......
# crbug.com/417518: Get tests working with --site-per-process # crbug.com/417518: Get tests working with --site-per-process
-BrowserTest.OtherRedirectsDontForkProcess -BrowserTest.OtherRedirectsDontForkProcess
-ChromeRenderProcessHostTest.ProcessOverflow
-ChromeRenderProcessHostTest.ProcessPerTab
-ChromeRenderProcessHostTestWithCommandLine.ProcessOverflowCommandLine
-PrerenderBrowserTest.PrerenderLocationReplaceGWSHistograms
-ProcessManagementTest.ExtensionProcessBalancing
-ProcessManagementTest.ProcessOverflow
# crbug.com/671734: WebNavigationApiTest.ServerRedirectSingleProcess from # crbug.com/671734: WebNavigationApiTest.ServerRedirectSingleProcess from
# fails with --site-per-process # fails with --site-per-process
-WebNavigationApiTest.ServerRedirectSingleProcess -WebNavigationApiTest.ServerRedirectSingleProcess
# crbug.com/671712: CookieIsolation test fails with --site-per-process
-IsolatedAppTest.CookieIsolation
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment