Chromium Code Reviews| Index: chrome/browser/site_details_browsertest.cc |
| diff --git a/chrome/browser/site_details_browsertest.cc b/chrome/browser/site_details_browsertest.cc |
| index f233fe2fade439d3e39fb8834e9cc2d232c9cb38..6f50588c5a2b8313a385ff0cd2c38e3f5ae08f1c 100644 |
| --- a/chrome/browser/site_details_browsertest.cc |
| +++ b/chrome/browser/site_details_browsertest.cc |
| @@ -102,32 +102,24 @@ class TestMemoryDetails : public MetricsMemoryDetails { |
| IsolationScenarioType GetCurrentPolicy() { |
| if (content::AreAllSitesIsolatedForTesting()) |
| return ISOLATE_ALL_SITES; |
| - if (extensions::IsIsolateExtensionsEnabled()) |
| - return ISOLATE_EXTENSIONS; |
| return ISOLATE_NOTHING; |
| } |
| -// This matcher takes three other matchers as arguments, and applies one of them |
| +// This matcher takes two other matchers as arguments, and applies one of them |
| // depending on the current site isolation mode. The first applies if no site |
| -// isolation mode is active; the second applies under --isolate-extensions mode; |
| -// and the third applies under --site-per-process mode. |
| -MATCHER_P3(DependingOnPolicy, |
| +// isolation mode is active; and the second applies under --site-per-process |
| +// mode. |
| +MATCHER_P2(DependingOnPolicy, |
| isolate_nothing, |
| - isolate_extensions, |
| isolate_all_sites, |
| GetCurrentPolicy() == ISOLATE_NOTHING |
| ? std::string("(with oopifs disabled) ") + |
| PrintToString(isolate_nothing) |
| - : GetCurrentPolicy() == ISOLATE_EXTENSIONS |
| - ? std::string("(under --isolate-extensions) ") + |
| - PrintToString(isolate_extensions) |
| - : std::string("(under --site-per-process) ") + |
| - PrintToString(isolate_all_sites)) { |
| + : std::string("(under --site-per-process) ") + |
| + PrintToString(isolate_all_sites)) { |
| switch (GetCurrentPolicy()) { |
| case ISOLATE_NOTHING: |
|
ncarter (slow)
2017/05/01 20:15:19
ISOLATE_NOTHING ought to be the unreachable case n
nasko
2017/05/01 21:25:37
Are you suggesting it should be #ifdef'd for Andro
ncarter (slow)
2017/05/01 21:37:43
Hmm, probably not necessary to ifdef on android, s
|
| return ExplainMatchResult(isolate_nothing, arg, result_listener); |
| - case ISOLATE_EXTENSIONS: |
| - return ExplainMatchResult(isolate_extensions, arg, result_listener); |
| case ISOLATE_ALL_SITES: |
| return ExplainMatchResult(isolate_all_sites, arg, result_listener); |
| default: |
| @@ -148,8 +140,8 @@ MATCHER_P2(Sample, |
| // Allow matchers to be pretty-printed when passed to PrintToString() for the |
| // cases we care about. |
| -template <typename P1, typename P2, typename P3> |
| -void PrintTo(const DependingOnPolicyMatcherP3<P1, P2, P3>& matcher, |
| +template <typename P1, typename P2> |
| +void PrintTo(const DependingOnPolicyMatcherP2<P1, P2>& matcher, |
| std::ostream* os) { |
| testing::Matcher<int> matcherCast = matcher; |
| matcherCast.DescribeTo(os); |
| @@ -403,23 +395,13 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ManyIframes) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateHttpsSitesProcessCountNoLimit"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 9)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 14)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 9)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 14)); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 114))); |
| + HasOneSample(DependingOnPolicy(0, 114))); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(0, 0, 114))); |
| + HasOneSample(DependingOnPolicy(0, 114))); |
| // Navigate to a different, disjoint set of 7 sites. |
| GURL pqrstuv_url = embedded_test_server()->GetURL( |
| @@ -458,23 +440,13 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ManyIframes) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateHttpsSitesProcessCountNoLimit"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 7)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 11)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 7)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 11)); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 68))); |
| + HasOneSample(DependingOnPolicy(0, 68))); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(0, 0, 68))); |
| + HasOneSample(DependingOnPolicy(0, 68))); |
| // Open a second tab (different BrowsingInstance) with 4 sites (a through d). |
| GURL abcd_url = embedded_test_server()->GetURL( |
| @@ -512,25 +484,14 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ManyIframes) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateHttpsSitesProcessCountNoLimit"), |
| HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(2, 2, 11)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 14)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(2, 11)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 14)); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 81))); |
| - EXPECT_THAT( |
| - details->uma()->GetAllSamples( |
| - "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Bucket(0, 2)), ElementsAre(Bucket(0, 2)), |
| - ElementsAre(Bucket(12, 1), Bucket(68, 1)))); |
| + HasOneSample(DependingOnPolicy(0, 81))); |
| + EXPECT_THAT(details->uma()->GetAllSamples( |
| + "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| + DependingOnPolicy(ElementsAre(Bucket(0, 2)), |
| + ElementsAre(Bucket(12, 1), Bucket(68, 1)))); |
| // Open a third tab (different BrowsingInstance) with the same 4 sites. |
| AddTabAtIndex(2, abcd_url, ui::PAGE_TRANSITION_TYPED); |
| @@ -566,25 +527,14 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ManyIframes) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateHttpsSitesProcessCountNoLimit"), |
| HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 15)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 17)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 15)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 17)); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 96))); |
| - EXPECT_THAT( |
| - details->uma()->GetAllSamples( |
| - "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Bucket(0, 3)), ElementsAre(Bucket(0, 3)), |
| - ElementsAre(Bucket(12, 2), Bucket(68, 1)))); |
| + HasOneSample(DependingOnPolicy(0, 96))); |
| + EXPECT_THAT(details->uma()->GetAllSamples( |
| + "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| + DependingOnPolicy(ElementsAre(Bucket(0, 3)), |
| + ElementsAre(Bucket(12, 2), Bucket(68, 1)))); |
| // From the third tab, window.open() a fourth tab in the same |
| // BrowsingInstance, to a page using the same four sites "a-d" as third tab, |
| @@ -633,313 +583,15 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ManyIframes) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateHttpsSitesProcessCountNoLimit"), |
| HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 16)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 21)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 16)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 21)); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 114))); |
| + HasOneSample(DependingOnPolicy(0, 114))); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| DependingOnPolicy( |
| - ElementsAre(Bucket(0, 3)), ElementsAre(Bucket(0, 3)), |
| + ElementsAre(Bucket(0, 3)), |
| ElementsAre(Bucket(12, 1), Bucket(29, 1), Bucket(68, 1)))); |
| - |
| - // This test doesn't navigate to any extensions URLs, so it should not be |
| - // in any of the field trial groups. |
| - EXPECT_FALSE(IsInTrial("SiteIsolationExtensionsActive")); |
| -} |
| - |
| -// Flaky on Windows and Mac. crbug.com/671891 |
| -#if defined(OS_WIN) || defined(OS_MACOSX) |
| -#define MAYBE_IsolateExtensions DISABLED_IsolateExtensions |
| -#else |
| -#define MAYBE_IsolateExtensions IsolateExtensions |
| -#endif |
| -IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, MAYBE_IsolateExtensions) { |
| - // We start on "about:blank", which should be credited with a process in this |
| - // case. |
| - scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), 1); |
| - EXPECT_EQ(0, details->GetOutOfProcessIframeCount()); |
| - |
| - // Install one script-injecting extension with background page, and an |
| - // extension with web accessible resources. |
| - const Extension* extension1 = CreateExtension("Extension One", true); |
| - const Extension* extension2 = CreateExtension("Extension Two", false); |
| - |
| - // Open two a.com tabs (with cross site http iframes). IsolateExtensions mode |
| - // should have no effect so far, since there are no frames straddling the |
| - // extension/web boundary. |
| - GURL tab1_url = embedded_test_server()->GetURL( |
| - "a.com", "/cross_site_iframe_factory.html?a(b,c)"); |
| - ui_test_utils::NavigateToURL(browser(), tab1_url); |
| - WebContents* tab1 = browser()->tab_strip_model()->GetWebContentsAt(0); |
| - GURL tab2_url = embedded_test_server()->GetURL( |
| - "a.com", "/cross_site_iframe_factory.html?a(d,e)"); |
| - AddTabAtIndex(1, tab2_url, ui::PAGE_TRANSITION_TYPED); |
| - WebContents* tab2 = browser()->tab_strip_model()->GetWebContentsAt(1); |
| - |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 7)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 4)); |
| - |
| - // Test that "one process per extension" applies even when web content has an |
| - // extension iframe. |
| - |
| - // Tab1 navigates its first iframe to a resource of extension1. This shouldn't |
| - // result in a new extension process (it should share with extension1's |
| - // background page). |
| - content::NavigateIframeToURL( |
| - tab1, "child-0", extension1->GetResourceURL("/blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 6)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 1, 4)); |
| - |
| - // Tab2 navigates its first iframe to a resource of extension1. This also |
| - // shouldn't result in a new extension process (it should share with the |
| - // background page and the other iframe). |
| - content::NavigateIframeToURL( |
| - tab2, "child-0", extension1->GetResourceURL("/blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 5)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 2, 4)); |
| - |
| - // Tab1 navigates its second iframe to a resource of extension2. This SHOULD |
| - // result in a new process since extension2 had no existing process. |
| - content::NavigateIframeToURL( |
| - tab1, "child-1", extension2->GetResourceURL("/blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 4, 5)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 3, 4)); |
| - |
| - // Tab2 navigates its second iframe to a resource of extension2. This should |
| - // share the existing extension2 process. |
| - content::NavigateIframeToURL( |
| - tab2, "child-1", extension2->GetResourceURL("/blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 4, 4)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 4, 4)); |
| - |
| - // Install extension3 (identical config to extension2) |
| - const Extension* extension3 = CreateExtension("Extension Three", false); |
| - |
| - // Navigate Tab2 to a top-level page from extension3. There are four processes |
| - // now: one for tab1's main frame, and one for each of the extensions: |
| - // extension1 has a process because it has a background page; extension2 is |
| - // used as an iframe in tab1, and extension3 is the top-level frame in tab2. |
| - ui_test_utils::NavigateToURL(browser(), |
| - extension3->GetResourceURL("blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 4, 4)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 2, 2)); |
| - |
| - // Navigate tab2 to a different extension3 page containing a web iframe. The |
| - // iframe should get its own process. The lower bound number indicates that, |
| - // in theory, the iframe could share a process with tab1's main frame. |
| - ui_test_utils::NavigateToURL(browser(), |
| - extension3->GetResourceURL("http_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(5)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(5)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 5, 5)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 3, 3)); |
| - |
| - // Navigate tab1 to an extension3 page with an extension3 iframe. There should |
| - // be three processes estimated by IsolateExtensions: one for extension3, one |
| - // for extension1's background page, and one for the web iframe in tab2. |
| - browser()->tab_strip_model()->ActivateTabAt(0, true); |
| - ui_test_utils::NavigateToURL(browser(), |
| - extension3->GetResourceURL("blank_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(2, 3, 3)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 1, 1)); |
| - |
| - // Now navigate tab1 to an extension3 page with a web iframe. This could share |
| - // a process with tab2's iframe (the LowerBound number), or it could get its |
| - // own process (the Estimate number). |
| - ui_test_utils::NavigateToURL(browser(), |
| - extension3->GetResourceURL("http_iframe.html")); |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(3)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(4)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(2, 4, 4)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 2, 2)); |
| - |
| - EXPECT_TRUE(IsInTrial("SiteIsolationExtensionsActive")); |
| } |
| // Due to http://crbug.com/612711, we are not isolating iframes from platform |
| @@ -955,46 +607,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, PlatformAppsNotIsolated) { |
| EXPECT_EQ(0, details->GetOutOfProcessIframeCount()); |
| } |
| -// Exercises accounting in the case where an extension has two different-site |
| -// web iframes. |
| -IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ExtensionWithTwoWebIframes) { |
| - scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - |
| - // Install one script-injecting extension with background page, and an |
| - // extension with web accessible resources. |
| - const Extension* extension = CreateExtension("Test Extension", false); |
| - |
| - ui_test_utils::NavigateToURL( |
| - browser(), extension->GetResourceURL("/two_http_iframes.html")); |
| - |
| - details = new TestMemoryDetails(); |
| - details->StartFetchAndWait(); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.CurrentRendererProcessCount"), |
| - HasOneSample(GetRenderProcessCount())); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(2)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(2)); |
| - // TODO(nick): https://crbug.com/512560 Make the number below agree with the |
| - // estimates above, which assume consolidation of subframe processes. |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 3, 3)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 2, 2)); |
| - |
| - EXPECT_TRUE(IsInTrial("SiteIsolationExtensionsActive")); |
| -} |
| - |
| -// Verifies that --isolate-extensions doesn't isolate hosted apps. |
| +// Verifies that hosted apps are not isolated. |
| IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| GURL app_with_web_iframe_url = embedded_test_server()->GetURL( |
| "app.org", "/cross_site_iframe_factory.html?app.org(b.com)"); |
| @@ -1011,16 +624,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
| HasOneSample(2)); |
| @@ -1030,9 +634,8 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
| HasOneSample(2)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 1)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 1)); |
| ui_test_utils::NavigateToURL(browser(), app_in_web_iframe_url); |
| details = new TestMemoryDetails(); |
| @@ -1043,16 +646,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
| HasOneSample(2)); |
| @@ -1062,15 +656,14 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
| HasOneSample(2)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 1)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 1)); |
| // Now install app.org as a hosted app. |
| CreateHostedApp("App", GURL("http://app.org")); |
| // Reload the same two pages, and verify that the hosted app still is not |
| - // isolated by --isolate-extensions, but is isolated by --site-per-process. |
| + // isolated by default, but is isolated by --site-per-process. |
| ui_test_utils::NavigateToURL(browser(), app_with_web_iframe_url); |
| details = new TestMemoryDetails(); |
| details->StartFetchAndWait(); |
| @@ -1080,16 +673,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
| HasOneSample(2)); |
| @@ -1099,9 +683,8 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
| HasOneSample(2)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 1)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 1)); |
| ui_test_utils::NavigateToURL(browser(), app_in_web_iframe_url); |
| details = new TestMemoryDetails(); |
| @@ -1112,16 +695,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateNothingProcessCountEstimate"), |
| HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(details->uma()->GetAllSamples( |
| - "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| - HasOneSample(1)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
| HasOneSample(2)); |
| @@ -1131,46 +705,8 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
| HasOneSample(2)); |
| - EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 2)); |
| - EXPECT_THAT(details->GetOutOfProcessIframeCount(), |
| - DependingOnPolicy(0, 0, 1)); |
| - |
| - // Since hosted apps are excluded from isolation, this test should not be |
| - // in any of the field trial groups. |
| - EXPECT_FALSE(IsInTrial("SiteIsolationExtensionsActive")); |
| -} |
| - |
| -// Verifies that the client is put in the appropriate field trial group. |
| -IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, VerifyFieldTrialGroup) { |
| - const Extension* extension = CreateExtension("Extension", false); |
| - GURL tab1_url = embedded_test_server()->GetURL( |
| - "a.com", "/cross_site_iframe_factory.html?a(b,c)"); |
| - ui_test_utils::NavigateToURL(browser(), tab1_url); |
| - WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); |
| - |
| - // Tab navigates its second iframe to a page of the extension. |
| - content::NavigateIframeToURL(tab, "child-1", |
| - extension->GetResourceURL("/blank_iframe.html")); |
| - |
| - std::string group; |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kSitePerProcess)) { |
| - group = "SitePerProcessFlag"; |
| - } else if (extensions::IsIsolateExtensionsEnabled()) { |
| - if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| - extensions::switches::kIsolateExtensions)) { |
| - group = "IsolateExtensionsFlag"; |
| - } else { |
| - group = "FieldTrial"; |
| - } |
| - } else { |
| - if (base::FieldTrialList::FindFullName("SiteIsolationExtensions").empty()) |
| - group = "Default"; |
| - else |
| - group = "Control"; |
| - } |
| - |
| - EXPECT_TRUE(IsInTrialGroup("SiteIsolationExtensionsActive", group)); |
| + EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 2)); |
| + EXPECT_THAT(details->GetOutOfProcessIframeCount(), DependingOnPolicy(0, 1)); |
| } |
| // Verifies that the UMA counter for SiteInstances in a BrowsingInstance is |
| @@ -1187,16 +723,14 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, |
| scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); |
| details->StartFetchAndWait(); |
| - // Since there are no extensions involved, the results in the default case |
| - // and extensions::IsIsolateExtensionsEnabled() are the same. |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(1, 1, 9))); |
| + HasOneSample(DependingOnPolicy(1, 9))); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 114))); |
| + HasOneSample(DependingOnPolicy(0, 114))); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(0, 0, 114))); |
| + HasOneSample(DependingOnPolicy(0, 114))); |
| // Open another tab through window.open(), which will be in the same |
| // BrowsingInstance. |
| @@ -1215,12 +749,12 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, |
| details->StartFetchAndWait(); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(1, 1, 11))); |
| + HasOneSample(DependingOnPolicy(1, 11))); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 160))); |
| + HasOneSample(DependingOnPolicy(0, 160))); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(0, 0, 160))); |
| + HasOneSample(DependingOnPolicy(0, 160))); |
| // Open a tab, which will be in a different BrowsingInstance. |
| GURL abcd_url = embedded_test_server()->GetURL( |
| @@ -1229,18 +763,16 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, |
| details = new TestMemoryDetails(); |
| details->StartFetchAndWait(); |
| - EXPECT_THAT( |
| - details->uma()->GetAllSamples( |
| - "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Sample(1, 2)), ElementsAre(Sample(1, 2)), |
| - ElementsAre(Sample(4, 1), Sample(11, 1)))); |
| + EXPECT_THAT(details->uma()->GetAllSamples( |
| + "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| + DependingOnPolicy(ElementsAre(Sample(1, 2)), |
| + ElementsAre(Sample(4, 1), Sample(11, 1)))); |
| EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"), |
| - HasOneSample(DependingOnPolicy(0, 0, 160))); |
| - EXPECT_THAT( |
| - details->uma()->GetAllSamples( |
| - "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Sample(0, 2)), ElementsAre(Sample(0, 2)), |
| - ElementsAre(Sample(12, 1), Sample(160, 1)))); |
| + HasOneSample(DependingOnPolicy(0, 160))); |
| + EXPECT_THAT(details->uma()->GetAllSamples( |
| + "SiteIsolation.ProxyCountPerBrowsingInstance"), |
| + DependingOnPolicy(ElementsAre(Sample(0, 2)), |
| + ElementsAre(Sample(12, 1), Sample(160, 1)))); |
| } |
| // Verifies that the UMA counter for SiteInstances in a BrowsingInstance is |
| @@ -1248,7 +780,7 @@ IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, |
| IN_PROC_BROWSER_TEST_F( |
| SiteDetailsBrowserTest, |
| VerifySiteInstanceCountInBrowsingInstanceWithExtensions) { |
| - // Open two a.com tabs (with cross site http iframes). IsolateExtensions mode |
| + // Open two a.com tabs (with cross site http iframes). Isolating extensions |
| // should have no effect so far, since there are no frames straddling the |
| // extension/web boundary. |
| GURL tab_url = embedded_test_server()->GetURL( |
| @@ -1257,12 +789,9 @@ IN_PROC_BROWSER_TEST_F( |
| WebContents* tab = browser()->tab_strip_model()->GetWebContentsAt(0); |
| scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); |
| details->StartFetchAndWait(); |
| - |
| - // Since there are no extensions loaded yet, the results in the default case |
| - // and extensions::IsIsolateExtensionsEnabled() are the same. |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(1, 1, 5))); |
| + HasOneSample(DependingOnPolicy(1, 5))); |
| // Load an extension without a background page, which will avoid creating a |
| // BrowsingInstance for it. |
| @@ -1277,7 +806,7 @@ IN_PROC_BROWSER_TEST_F( |
| details->StartFetchAndWait(); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - HasOneSample(DependingOnPolicy(1, 2, 5))); |
| + HasOneSample(DependingOnPolicy(2, 5))); |
| // Now load an extension with a background page. This will result in a |
| // BrowsingInstance for the background page. |
| @@ -1286,8 +815,7 @@ IN_PROC_BROWSER_TEST_F( |
| details->StartFetchAndWait(); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Bucket(1, 2)), |
| - ElementsAre(Bucket(1, 1), Bucket(2, 1)), |
| + DependingOnPolicy(ElementsAre(Bucket(1, 1), Bucket(2, 1)), |
| ElementsAre(Bucket(1, 1), Bucket(5, 1)))); |
| // Navigate the second iframe of the tab to the second extension. It should |
| @@ -1298,7 +826,6 @@ IN_PROC_BROWSER_TEST_F( |
| details->StartFetchAndWait(); |
| EXPECT_THAT(details->uma()->GetAllSamples( |
| "SiteIsolation.SiteInstancesPerBrowsingInstance"), |
| - DependingOnPolicy(ElementsAre(Bucket(1, 2)), |
| - ElementsAre(Bucket(1, 1), Bucket(3, 1)), |
| + DependingOnPolicy(ElementsAre(Bucket(1, 1), Bucket(3, 1)), |
| ElementsAre(Bucket(1, 1), Bucket(5, 1)))); |
| } |