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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.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 #include <list> 5 #include <list>
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/interstitials/chrome_controller_client.h" 8 #include "chrome/browser/interstitials/chrome_controller_client.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool is_extended_reporting_opt_in_allowed = 86 bool is_extended_reporting_opt_in_allowed =
87 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed); 87 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed);
88 bool is_proceed_anyway_disabled = 88 bool is_proceed_anyway_disabled =
89 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled); 89 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled);
90 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options( 90 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options(
91 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), 91 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
92 is_extended_reporting_opt_in_allowed, 92 is_extended_reporting_opt_in_allowed,
93 web_contents->GetBrowserContext()->IsOffTheRecord(), 93 web_contents->GetBrowserContext()->IsOffTheRecord(),
94 IsExtendedReportingEnabled(*prefs), IsScout(*prefs), 94 IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
95 is_proceed_anyway_disabled, 95 is_proceed_anyway_disabled,
96 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources)); 96 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
97 "cpn_safe_browsing" /* help_center_article_link */);
97 return new TestSafeBrowsingBlockingPage(manager, web_contents, 98 return new TestSafeBrowsingBlockingPage(manager, web_contents,
98 main_frame_url, unsafe_resources, 99 main_frame_url, unsafe_resources,
99 display_options); 100 display_options);
100 } 101 }
101 }; 102 };
102 103
103 class MockTestingProfile : public TestingProfile { 104 class MockTestingProfile : public TestingProfile {
104 public: 105 public:
105 MockTestingProfile() {} 106 MockTestingProfile() {}
106 virtual ~MockTestingProfile() {} 107 virtual ~MockTestingProfile() {}
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 bool is_extended_reporting_opt_in_allowed = 168 bool is_extended_reporting_opt_in_allowed =
168 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed); 169 prefs->GetBoolean(prefs::kSafeBrowsingExtendedReportingOptInAllowed);
169 bool is_proceed_anyway_disabled = 170 bool is_proceed_anyway_disabled =
170 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled); 171 prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled);
171 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options( 172 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options(
172 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), 173 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
173 is_extended_reporting_opt_in_allowed, 174 is_extended_reporting_opt_in_allowed,
174 web_contents->GetBrowserContext()->IsOffTheRecord(), 175 web_contents->GetBrowserContext()->IsOffTheRecord(),
175 IsExtendedReportingEnabled(*prefs), IsScout(*prefs), 176 IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
176 is_proceed_anyway_disabled, 177 is_proceed_anyway_disabled,
177 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources)); 178 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
179 "cpn_safe_browsing" /* help_center_article_link */);
178 return new TestSafeBrowsingBlockingPageQuiet( 180 return new TestSafeBrowsingBlockingPageQuiet(
179 manager, web_contents, main_frame_url, unsafe_resources, 181 manager, web_contents, main_frame_url, unsafe_resources,
180 display_options); 182 display_options);
181 } 183 }
182 }; 184 };
183 185
184 } // namespace 186 } // namespace
185 187
186 class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { 188 class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness {
187 public: 189 public:
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 EXPECT_TRUE(sb_interstitial); 1029 EXPECT_TRUE(sb_interstitial);
1028 1030
1029 sb_interstitial->SetGiantWebView(); 1031 sb_interstitial->SetGiantWebView();
1030 base::DictionaryValue load_time_data = sb_interstitial->GetUIStrings(); 1032 base::DictionaryValue load_time_data = sb_interstitial->GetUIStrings();
1031 bool is_giant; 1033 bool is_giant;
1032 load_time_data.GetBoolean("is_giant", &is_giant); 1034 load_time_data.GetBoolean("is_giant", &is_giant);
1033 EXPECT_TRUE(is_giant); 1035 EXPECT_TRUE(is_giant);
1034 } 1036 }
1035 1037
1036 } // namespace safe_browsing 1038 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc ('k') | chrome/browser/safe_browsing/ui_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698