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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 2510003002: If replacing a safebrowsing interstitial, don't call DontProceed on the old one. (Closed)
Patch Set: set TODO url for crbug.com/666172 Created 4 years, 1 month 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/safe_browsing/safe_browsing_blocking_page_test.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
index ac689e669aed028fbbe2d38dd04560cc2968580e..5bed346295e63c828413fbe7def0e53d8c8ac90c 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
@@ -916,6 +916,45 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
net::URLRequestMockHTTPJob::GetMockUrl(kEmptyPage));
}
+// Verifies that the reporting checkbox is still shown if the page is reloaded
+// while the interstitial is showing.
+IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
+ ReloadWhileInterstitialShowing) {
+ // Start navigation to bad page (kEmptyPage), which will be blocked before it
+ // is committed.
+ GURL url = SetupWarningAndNavigate();
meacer 2016/11/30 00:04:09 nit: const?
mattm 2016/11/30 00:47:41 Done.
+
+ // Checkbox should be showing.
+ EXPECT_EQ(VISIBLE, GetVisibility("extended-reporting-opt-in"));
+
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(tab);
+ // Security indicator should be showing.
+ ExpectSecurityIndicatorDowngrade(tab, 0u);
+
+ // Check navigation entry state.
+ NavigationController& controller = tab->GetController();
meacer 2016/11/30 00:04:09 const
mattm 2016/11/30 00:47:41 Done.
+ ASSERT_TRUE(controller.GetVisibleEntry());
+ EXPECT_EQ(controller.GetVisibleEntry()->GetURL(), url);
meacer 2016/11/30 00:04:09 nit: The order of params seems reversed here. url
mattm 2016/11/30 00:47:41 Done.
+ ASSERT_TRUE(controller.GetPendingEntry());
+ EXPECT_EQ(controller.GetPendingEntry()->GetURL(), url);
+
+ // "Reload" the tab.
+ SetupWarningAndNavigate();
+
+ // Checkbox should be showing.
+ EXPECT_EQ(VISIBLE, GetVisibility("extended-reporting-opt-in"));
+
+ // TODO(crbug.com/666172): Security indicator should be showing.
+ // ExpectSecurityIndicatorDowngrade(tab, 0u);
meacer 2016/11/30 00:04:09 Is this intentionally commented out? If so, you mi
mattm 2016/11/30 00:47:41 Done.
+
+ // Check navigation entry state.
+ ASSERT_TRUE(controller.GetVisibleEntry());
+ EXPECT_EQ(controller.GetVisibleEntry()->GetURL(), url);
+ ASSERT_TRUE(controller.GetPendingEntry());
+ EXPECT_EQ(controller.GetPendingEntry()->GetURL(), url);
+}
+
IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, LearnMore) {
SetupWarningAndNavigate();
EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link"));

Powered by Google App Engine
This is Rietveld 408576698