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

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

Issue 2700323002: Refactor BaseBlockingPage to reduce duplicated code (Closed)
Patch Set: Created 3 years, 10 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 const GURL& main_frame_url, 235 const GURL& main_frame_url,
236 const UnsafeResourceList& unsafe_resources, 236 const UnsafeResourceList& unsafe_resources,
237 const SafeBrowsingErrorUI::SBErrorDisplayOptions& display_options) 237 const SafeBrowsingErrorUI::SBErrorDisplayOptions& display_options)
238 : SafeBrowsingBlockingPage(manager, 238 : SafeBrowsingBlockingPage(manager,
239 web_contents, 239 web_contents,
240 main_frame_url, 240 main_frame_url,
241 unsafe_resources, 241 unsafe_resources,
242 display_options), 242 display_options),
243 wait_for_delete_(false) { 243 wait_for_delete_(false) {
244 // Don't wait the whole 3 seconds for the browser test. 244 // Don't wait the whole 3 seconds for the browser test.
245 threat_details_proceed_delay_ms_ = 100; 245 SetThreatDetailsProceedDelayForTesting(100);
246 } 246 }
247 247
248 ~TestSafeBrowsingBlockingPage() override { 248 ~TestSafeBrowsingBlockingPage() override {
249 if (!wait_for_delete_) 249 if (!wait_for_delete_)
250 return; 250 return;
251 251
252 // Notify that we are gone 252 // Notify that we are gone
253 base::MessageLoopForUI::current()->QuitWhenIdle(); 253 base::MessageLoopForUI::current()->QuitWhenIdle();
254 wait_for_delete_ = false; 254 wait_for_delete_ = false;
255 } 255 }
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 1379
1380 INSTANTIATE_TEST_CASE_P( 1380 INSTANTIATE_TEST_CASE_P(
1381 SafeBrowsingBlockingPageIDNTestWithThreatType, 1381 SafeBrowsingBlockingPageIDNTestWithThreatType,
1382 SafeBrowsingBlockingPageIDNTest, 1382 SafeBrowsingBlockingPageIDNTest,
1383 testing::Combine(testing::Values(false, true), 1383 testing::Combine(testing::Values(false, true),
1384 testing::Values(SB_THREAT_TYPE_URL_MALWARE, 1384 testing::Values(SB_THREAT_TYPE_URL_MALWARE,
1385 SB_THREAT_TYPE_URL_PHISHING, 1385 SB_THREAT_TYPE_URL_PHISHING,
1386 SB_THREAT_TYPE_URL_UNWANTED))); 1386 SB_THREAT_TYPE_URL_UNWANTED)));
1387 1387
1388 } // namespace safe_browsing 1388 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698