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

Unified Diff: chrome/browser/site_details_browsertest.cc

Issue 1688963002: UMA stats to count RenderFrameProxyHosts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uma2
Patch Set: Created 4 years, 10 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
Index: chrome/browser/site_details_browsertest.cc
diff --git a/chrome/browser/site_details_browsertest.cc b/chrome/browser/site_details_browsertest.cc
index c364c923d555948be0c32016e50fb34188884886..c3880f1031e0e82e4d0b7a7f1d1f17b7631e0701 100644
--- a/chrome/browser/site_details_browsertest.cc
+++ b/chrome/browser/site_details_browsertest.cc
@@ -376,6 +376,11 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest, ManyIframes) {
EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 9));
EXPECT_THAT(details->GetOutOfProcessIframeCount(),
DependingOnPolicy(0, 0, 14));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
Charlie Reis 2016/02/10 22:37:52 Looks like we have 15*(9-1) proxies in this case (
ncarter (slow) 2016/02/10 23:22:14 Increased both to 10000. The higher max doesn't ac
+ EXPECT_THAT(details->uma()->GetAllSamples(
+ "SiteIsolation.ProxyCountPerBrowsingInstance"),
+ HasOneSample(DependingOnPolicy(0, 0, 120)));
// Navigate to a different, disjoint set of 7 sites.
GURL pqrstuv_url = embedded_test_server()->GetURL(
@@ -426,6 +431,11 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest, ManyIframes) {
EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(1, 1, 7));
EXPECT_THAT(details->GetOutOfProcessIframeCount(),
DependingOnPolicy(0, 0, 11));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 76)));
+ EXPECT_THAT(details->uma()->GetAllSamples(
+ "SiteIsolation.ProxyCountPerBrowsingInstance"),
+ HasOneSample(DependingOnPolicy(0, 0, 75)));
Charlie Reis 2016/02/10 22:37:51 No discrepancy expected here, right?
ncarter (slow) 2016/02/10 23:22:14 They are the same input value, but the histograms
// Open a second tab (different BrowsingInstance) with 4 sites (a through d).
GURL abcd_url = embedded_test_server()->GetURL(
@@ -475,6 +485,13 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest, ManyIframes) {
EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(2, 2, 11));
EXPECT_THAT(details->GetOutOfProcessIframeCount(),
DependingOnPolicy(0, 0, 14));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 90)));
+ EXPECT_THAT(
+ details->uma()->GetAllSamples(
+ "SiteIsolation.ProxyCountPerBrowsingInstance"),
+ DependingOnPolicy(ElementsAre(Bucket(0, 2)), ElementsAre(Bucket(0, 2)),
+ ElementsAre(Bucket(12, 1), Bucket(75, 1))));
// Open a third tab (different BrowsingInstance) with the same 4 sites.
AddTabAtIndex(2, abcd_url, ui::PAGE_TRANSITION_TYPED);
@@ -522,6 +539,13 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest, ManyIframes) {
EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 15));
EXPECT_THAT(details->GetOutOfProcessIframeCount(),
DependingOnPolicy(0, 0, 17));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
+ EXPECT_THAT(
+ details->uma()->GetAllSamples(
+ "SiteIsolation.ProxyCountPerBrowsingInstance"),
+ DependingOnPolicy(ElementsAre(Bucket(0, 3)), ElementsAre(Bucket(0, 3)),
+ ElementsAre(Bucket(12, 2), Bucket(75, 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,
@@ -582,6 +606,13 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest, ManyIframes) {
EXPECT_THAT(GetRenderProcessCount(), DependingOnPolicy(3, 3, 16));
EXPECT_THAT(details->GetOutOfProcessIframeCount(),
DependingOnPolicy(0, 0, 21));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
+ EXPECT_THAT(details->uma()->GetAllSamples(
+ "SiteIsolation.ProxyCountPerBrowsingInstance"),
+ DependingOnPolicy(
+ ElementsAre(Bucket(0, 3)), ElementsAre(Bucket(0, 3)),
+ ElementsAre(Bucket(12, 1), Bucket(29, 1), Bucket(75, 1))));
// This test doesn't navigate to any extensions URLs, so it should not be
// in any of the field trial groups.
@@ -1100,6 +1131,8 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest,
EXPECT_THAT(details->uma()->GetAllSamples(
"SiteIsolation.SiteInstancesPerBrowsingInstance"),
HasOneSample(DependingOnPolicy(1, 1, 9)));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
Charlie Reis 2016/02/10 22:37:51 Let's add the per-BrowsingInstance count expectati
ncarter (slow) 2016/02/10 23:22:14 Done.
// Open another tab through window.open(), which will be in the same
// BrowsingInstance.
@@ -1119,6 +1152,8 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest,
EXPECT_THAT(details->uma()->GetAllSamples(
"SiteIsolation.SiteInstancesPerBrowsingInstance"),
HasOneSample(DependingOnPolicy(1, 1, 11)));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
// Open a tab, which will be in a different BrowsingInstance.
GURL abcd_url = embedded_test_server()->GetURL(
@@ -1132,6 +1167,8 @@ IN_PROC_BROWSER_TEST_P(SiteDetailsBrowserTest,
"SiteIsolation.SiteInstancesPerBrowsingInstance"),
DependingOnPolicy(ElementsAre(Sample(1, 2)), ElementsAre(Sample(1, 2)),
ElementsAre(Sample(4, 1), Sample(11, 1))));
+ EXPECT_THAT(details->uma()->GetAllSamples("SiteIsolation.ProxyCount"),
+ HasOneSample(DependingOnPolicy(0, 0, 100)));
}
// Verifies that the UMA counter for SiteInstances in a BrowsingInstance is

Powered by Google App Engine
This is Rietveld 408576698