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

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

Issue 512083002: Deprecate old Safe Browsing reporting opt-ins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unneeded variable Created 6 years, 3 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/safe_browsing/safe_browsing_blocking_page.cc ('k') | chrome/common/pref_names.h » ('j') | 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_unittest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
index 664a6b70bc61f9085f9e6752c2b5de08dcb15e87..3043a9524c59a076877305b0c7a32ec577029337 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -664,72 +664,3 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsToggling) {
EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
prefs::kSafeBrowsingExtendedReportingEnabled));
}
-
-// Test that the transition from old to new preference works.
-TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsTransitionEnabled) {
- // The old pref is enabled.
- Profile* profile = Profile::FromBrowserContext(
- web_contents()->GetBrowserContext());
- profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
-
- // Start a load.
- controller().LoadURL(GURL(kBadURL), content::Referrer(),
- content::PAGE_TRANSITION_TYPED, std::string());
-
- // Simulate the load causing a safe browsing interstitial to be shown.
- ShowInterstitial(false, kBadURL);
- SafeBrowsingBlockingPage* sb_interstitial =
- GetSafeBrowsingBlockingPage();
- ASSERT_TRUE(sb_interstitial);
-
- base::RunLoop().RunUntilIdle();
-
- // At this point, nothing should have changed yet.
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingExtendedReportingEnabled));
-
- ProceedThroughInterstitial(sb_interstitial);
-
- // Since the user has proceeded without changing the checkbox, the new pref
- // has been updated.
- EXPECT_TRUE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingExtendedReportingEnabled));
-}
-
-// Test that the transition from old to new preference still respects the
-// user's checkbox preferences.
-TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsTransitionDisabled) {
- // The old pref is enabled.
- Profile* profile = Profile::FromBrowserContext(
- web_contents()->GetBrowserContext());
- profile->GetPrefs()->SetBoolean(prefs::kSafeBrowsingReportingEnabled, true);
-
- // Start a load.
- controller().LoadURL(GURL(kBadURL), content::Referrer(),
- content::PAGE_TRANSITION_TYPED, std::string());
-
- // Simulate the load causing a safe browsing interstitial to be shown.
- ShowInterstitial(false, kBadURL);
- SafeBrowsingBlockingPage* sb_interstitial =
- GetSafeBrowsingBlockingPage();
- ASSERT_TRUE(sb_interstitial);
-
- base::RunLoop().RunUntilIdle();
-
- // At this point, nothing should have changed yet.
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingExtendedReportingEnabled));
-
- // Simulate the user uncheck the report agreement checkbox.
- sb_interstitial->SetReportingPreference(false);
-
- ProceedThroughInterstitial(sb_interstitial);
-
- // The new pref is turned off.
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingExtendedReportingEnabled));
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingReportingEnabled));
- EXPECT_FALSE(profile->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingDownloadFeedbackEnabled));
-}
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698