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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 2890703002: SafeBrowsing: allow WebView to customize the Help Center URL (Closed)
Patch Set: Rebase and fix compile errors, no logic change Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This test creates a fake safebrowsing service, where we can inject known- 5 // This test creates a fake safebrowsing service, where we can inject known-
6 // threat urls. It then uses a real browser to go to these urls, and sends 6 // threat urls. It then uses a real browser to go to these urls, and sends
7 // "goback" or "proceed" commands and verifies they work. 7 // "goback" or "proceed" commands and verifies they work.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 bool is_extended_reporting_opt_in_allowed = 296 bool is_extended_reporting_opt_in_allowed =
297 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed); 297 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed);
298 bool is_proceed_anyway_disabled = 298 bool is_proceed_anyway_disabled =
299 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled); 299 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled);
300 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options( 300 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options(
301 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), 301 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
302 is_extended_reporting_opt_in_allowed, 302 is_extended_reporting_opt_in_allowed,
303 web_contents->GetBrowserContext()->IsOffTheRecord(), 303 web_contents->GetBrowserContext()->IsOffTheRecord(),
304 IsExtendedReportingEnabled(*prefs), IsScout(*prefs), 304 IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
305 is_proceed_anyway_disabled, 305 is_proceed_anyway_disabled,
306 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources)); 306 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
307 "cpn_safe_browsing" /* help_center_article_link */);
307 return new TestSafeBrowsingBlockingPage(delegate, web_contents, 308 return new TestSafeBrowsingBlockingPage(delegate, web_contents,
308 main_frame_url, unsafe_resources, 309 main_frame_url, unsafe_resources,
309 display_options); 310 display_options);
310 } 311 }
311 }; 312 };
312 313
313 // Tests the safe browsing blocking page in a browser. 314 // Tests the safe browsing blocking page in a browser.
314 class SafeBrowsingBlockingPageBrowserTest 315 class SafeBrowsingBlockingPageBrowserTest
315 : public CertVerifierBrowserTest, 316 : public CertVerifierBrowserTest,
316 public testing::WithParamInterface<testing::tuple<SBThreatType, bool>> { 317 public testing::WithParamInterface<testing::tuple<SBThreatType, bool>> {
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 1488
1488 INSTANTIATE_TEST_CASE_P( 1489 INSTANTIATE_TEST_CASE_P(
1489 SafeBrowsingBlockingPageIDNTestWithThreatType, 1490 SafeBrowsingBlockingPageIDNTestWithThreatType,
1490 SafeBrowsingBlockingPageIDNTest, 1491 SafeBrowsingBlockingPageIDNTest,
1491 testing::Combine(testing::Values(false, true), 1492 testing::Combine(testing::Values(false, true),
1492 testing::Values(SB_THREAT_TYPE_URL_MALWARE, 1493 testing::Values(SB_THREAT_TYPE_URL_MALWARE,
1493 SB_THREAT_TYPE_URL_PHISHING, 1494 SB_THREAT_TYPE_URL_PHISHING,
1494 SB_THREAT_TYPE_URL_UNWANTED))); 1495 SB_THREAT_TYPE_URL_UNWANTED)));
1495 1496
1496 } // namespace safe_browsing 1497 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698