| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/safe_browsing/ui_manager.h" | 5 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 10 #include "chrome/browser/safe_browsing/ui_manager.h" | 10 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 11 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 11 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
| 13 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 13 #include "components/safe_browsing_db/safe_browsing_prefs.h" |
| 14 #include "components/safe_browsing_db/util.h" | 14 #include "components/safe_browsing_db/util.h" |
| 15 #include "components/security_interstitials/core/safe_browsing_error_ui.h" | 15 #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" |
| 16 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
| 17 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
| 19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "content/public/browser/web_contents_delegate.h" | 20 #include "content/public/browser/web_contents_delegate.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "content/public/test/web_contents_tester.h" | 22 #include "content/public/test/web_contents_tester.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 25 | 25 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 public: | 337 public: |
| 338 TestSafeBrowsingBlockingPage(BaseUIManager* manager, | 338 TestSafeBrowsingBlockingPage(BaseUIManager* manager, |
| 339 content::WebContents* web_contents, | 339 content::WebContents* web_contents, |
| 340 const GURL& main_frame_url, | 340 const GURL& main_frame_url, |
| 341 const UnsafeResourceList& unsafe_resources) | 341 const UnsafeResourceList& unsafe_resources) |
| 342 : SafeBrowsingBlockingPage( | 342 : SafeBrowsingBlockingPage( |
| 343 manager, | 343 manager, |
| 344 web_contents, | 344 web_contents, |
| 345 main_frame_url, | 345 main_frame_url, |
| 346 unsafe_resources, | 346 unsafe_resources, |
| 347 SafeBrowsingErrorUI::SBErrorDisplayOptions( | 347 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions( |
| 348 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), | 348 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), |
| 349 false, | 349 false, |
| 350 false, | 350 false, |
| 351 false, | 351 false, |
| 352 false, | 352 false, |
| 353 false, | 353 false, |
| 354 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources))) { | 354 BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources))) { |
| 355 // Don't delay details at all for the unittest. | 355 // Don't delay details at all for the unittest. |
| 356 SetThreatDetailsProceedDelayForTesting(0); | 356 SetThreatDetailsProceedDelayForTesting(0); |
| 357 DontCreateViewForTesting(); | 357 DontCreateViewForTesting(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 SimulateBlockingPageDone(resources, true); | 414 SimulateBlockingPageDone(resources, true); |
| 415 EXPECT_TRUE(delegate.visible_security_state_changed()); | 415 EXPECT_TRUE(delegate.visible_security_state_changed()); |
| 416 | 416 |
| 417 waiter.WaitForCallback(); | 417 waiter.WaitForCallback(); |
| 418 EXPECT_TRUE(waiter.callback_called()); | 418 EXPECT_TRUE(waiter.callback_called()); |
| 419 EXPECT_TRUE(waiter.proceed()); | 419 EXPECT_TRUE(waiter.proceed()); |
| 420 EXPECT_TRUE(IsWhitelisted(resource)); | 420 EXPECT_TRUE(IsWhitelisted(resource)); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace safe_browsing | 423 } // namespace safe_browsing |
| OLD | NEW |