| OLD | NEW | 
|---|
| 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 | 
| 11 #include "base/bind.h" | 11 #include "base/bind.h" | 
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" | 
| 13 #include "base/macros.h" | 13 #include "base/macros.h" | 
| 14 #include "base/prefs/pref_service.h" |  | 
| 15 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" | 
| 16 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" | 
| 17 #include "base/test/histogram_tester.h" | 16 #include "base/test/histogram_tester.h" | 
| 18 #include "base/values.h" | 17 #include "base/values.h" | 
| 19 #include "build/build_config.h" | 18 #include "build/build_config.h" | 
| 20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" | 
| 21 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" | 20 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" | 
| 22 #include "chrome/browser/net/url_request_mock_util.h" | 21 #include "chrome/browser/net/url_request_mock_util.h" | 
| 23 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" | 
| 24 #include "chrome/browser/safe_browsing/local_database_manager.h" | 23 #include "chrome/browser/safe_browsing/local_database_manager.h" | 
| 25 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 24 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 
| 26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 25 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 
| 27 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 26 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 
| 28 #include "chrome/browser/safe_browsing/threat_details.h" | 27 #include "chrome/browser/safe_browsing/threat_details.h" | 
| 29 #include "chrome/browser/safe_browsing/ui_manager.h" | 28 #include "chrome/browser/safe_browsing/ui_manager.h" | 
| 30 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" | 
| 31 #include "chrome/browser/ui/browser_tabstrip.h" | 30 #include "chrome/browser/ui/browser_tabstrip.h" | 
| 32 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 31 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 
| 33 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" | 
| 34 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" | 
| 35 #include "chrome/test/base/in_process_browser_test.h" | 34 #include "chrome/test/base/in_process_browser_test.h" | 
| 36 #include "chrome/test/base/test_switches.h" | 35 #include "chrome/test/base/test_switches.h" | 
| 37 #include "chrome/test/base/ui_test_utils.h" | 36 #include "chrome/test/base/ui_test_utils.h" | 
|  | 37 #include "components/prefs/pref_service.h" | 
| 38 #include "components/safe_browsing_db/database_manager.h" | 38 #include "components/safe_browsing_db/database_manager.h" | 
| 39 #include "components/safe_browsing_db/test_database_manager.h" | 39 #include "components/safe_browsing_db/test_database_manager.h" | 
| 40 #include "components/security_interstitials/core/controller_client.h" | 40 #include "components/security_interstitials/core/controller_client.h" | 
| 41 #include "components/security_interstitials/core/metrics_helper.h" | 41 #include "components/security_interstitials/core/metrics_helper.h" | 
| 42 #include "content/public/browser/interstitial_page.h" | 42 #include "content/public/browser/interstitial_page.h" | 
| 43 #include "content/public/browser/navigation_controller.h" | 43 #include "content/public/browser/navigation_controller.h" | 
| 44 #include "content/public/browser/notification_types.h" | 44 #include "content/public/browser/notification_types.h" | 
| 45 #include "content/public/browser/render_frame_host.h" | 45 #include "content/public/browser/render_frame_host.h" | 
| 46 #include "content/public/browser/render_process_host.h" | 46 #include "content/public/browser/render_process_host.h" | 
| 47 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" | 
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1142 | 1142 | 
| 1143 INSTANTIATE_TEST_CASE_P( | 1143 INSTANTIATE_TEST_CASE_P( | 
| 1144     SafeBrowsingBlockingPageIDNTestWithThreatType, | 1144     SafeBrowsingBlockingPageIDNTestWithThreatType, | 
| 1145     SafeBrowsingBlockingPageIDNTest, | 1145     SafeBrowsingBlockingPageIDNTest, | 
| 1146     testing::Combine(testing::Values(false, true), | 1146     testing::Combine(testing::Values(false, true), | 
| 1147                      testing::Values(SB_THREAT_TYPE_URL_MALWARE, | 1147                      testing::Values(SB_THREAT_TYPE_URL_MALWARE, | 
| 1148                                      SB_THREAT_TYPE_URL_PHISHING, | 1148                                      SB_THREAT_TYPE_URL_PHISHING, | 
| 1149                                      SB_THREAT_TYPE_URL_UNWANTED))); | 1149                                      SB_THREAT_TYPE_URL_UNWANTED))); | 
| 1150 | 1150 | 
| 1151 }  // namespace safe_browsing | 1151 }  // namespace safe_browsing | 
| OLD | NEW | 
|---|