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

Unified Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 2966903002: Specialize Superfish interstitial metrics (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_browser_tests.cc
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index dbdefe17cda376f58dcdc4810d72c0383430e4ab..5892734fa607d1558377b38da79d1650fdbc8111 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -5003,6 +5003,46 @@ IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitial) {
interstitial_page, expected_title));
}
+// Tests that the Superfish interstitial records metrics under the correct
+// prefix.
+IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitialUMA) {
meacer 2017/06/30 22:40:28 This test subsumes the one above (SuperfishSSLUITe
estark 2017/06/30 22:50:48 Done, just added the metrics checks to the origina
+ base::HistogramTester histograms;
+ const std::string decision_histogram = "interstitial.superfish.decision";
+ const std::string interaction_histogram =
+ "interstitial.superfish.interaction";
+
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitFromCommandLine("SuperfishInterstitial",
+ std::string());
+ SetUpCertVerifier(true /* use superfish cert */);
+ ui_test_utils::NavigateToURL(browser(),
+ https_server_.GetURL("/ssl/google.html"));
+ content::WebContents* tab =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ content::WaitForInterstitialAttach(tab);
+ InterstitialPage* interstitial_page = tab->GetInterstitialPage();
+ ASSERT_TRUE(interstitial_page);
+ EXPECT_TRUE(WaitForRenderFrameReady(interstitial_page->GetMainFrame()));
+ EXPECT_EQ(SSLBlockingPage::kTypeForTesting,
+ interstitial_page->GetDelegateForTesting()->GetTypeForTesting());
+
+ // Look for keywords on the page to check that the Superfish interstitial is
+ // showing.
+ const std::string expected_title =
+ l10n_util::GetStringUTF8(IDS_SSL_SUPERFISH_HEADING);
+ EXPECT_TRUE(chrome_browser_interstitials::IsInterstitialDisplayingText(
+ interstitial_page, expected_title));
+
+ // Check that the correct histograms were recorded.
+ histograms.ExpectTotalCount(decision_histogram, 1);
+ histograms.ExpectBucketCount(decision_histogram,
+ security_interstitials::MetricsHelper::SHOW, 1);
+ histograms.ExpectTotalCount(interaction_histogram, 1);
+ histograms.ExpectBucketCount(
+ interaction_histogram,
+ security_interstitials::MetricsHelper::TOTAL_VISITS, 1);
+}
+
// Tests that the Superfish interstitial is not shown when the Finch feature is
// disabled.
IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitialDisabled) {
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698