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

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: review changes 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
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_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/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 f2e9b43eba39eacf826642164197acf3b66adeef..c1e00cd3f49987bbc0af65902fd2cca8025ead25 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
@@ -917,6 +917,46 @@ 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.
+ const GURL url = SetupWarningAndNavigate();
+
+ // 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.
+ const NavigationController& controller = tab->GetController();
+ ASSERT_TRUE(controller.GetVisibleEntry());
+ EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL());
+ ASSERT_TRUE(controller.GetPendingEntry());
+ EXPECT_EQ(url, controller.GetPendingEntry()->GetURL());
+
+ // "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.
+ // Call |ExpectSecurityIndicatorDowngrade(tab, 0u);| here once the bug is
+ // fixed.
+
+ // Check navigation entry state.
+ ASSERT_TRUE(controller.GetVisibleEntry());
+ EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL());
+ ASSERT_TRUE(controller.GetPendingEntry());
+ EXPECT_EQ(url, controller.GetPendingEntry()->GetURL());
+}
+
IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, LearnMore) {
SetupWarningAndNavigate();
EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link"));
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698