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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 1440303002: Componentize SecurityStateModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android/cros fixes Created 5 years, 1 month 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 "base/base_switches.h" 5 #include "base/base_switches.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/app/chrome_command_ids.h" 22 #include "chrome/app/chrome_command_ids.h"
23 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/chrome_notification_types.h" 24 #include "chrome/browser/chrome_notification_types.h"
25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
26 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" 26 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h"
27 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/ssl/bad_clock_blocking_page.h" 28 #include "chrome/browser/ssl/bad_clock_blocking_page.h"
29 #include "chrome/browser/ssl/cert_report_helper.h" 29 #include "chrome/browser/ssl/cert_report_helper.h"
30 #include "chrome/browser/ssl/cert_verifier_browser_test.h" 30 #include "chrome/browser/ssl/cert_verifier_browser_test.h"
31 #include "chrome/browser/ssl/certificate_reporting_test_utils.h" 31 #include "chrome/browser/ssl/certificate_reporting_test_utils.h"
32 #include "chrome/browser/ssl/chrome_security_state_model_delegate.h"
32 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" 33 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
33 #include "chrome/browser/ssl/common_name_mismatch_handler.h" 34 #include "chrome/browser/ssl/common_name_mismatch_handler.h"
34 #include "chrome/browser/ssl/security_state_model.h"
35 #include "chrome/browser/ssl/ssl_blocking_page.h" 35 #include "chrome/browser/ssl/ssl_blocking_page.h"
36 #include "chrome/browser/ssl/ssl_error_handler.h" 36 #include "chrome/browser/ssl/ssl_error_handler.h"
37 #include "chrome/browser/ui/browser.h" 37 #include "chrome/browser/ui/browser.h"
38 #include "chrome/browser/ui/browser_commands.h" 38 #include "chrome/browser/ui/browser_commands.h"
39 #include "chrome/browser/ui/browser_navigator.h" 39 #include "chrome/browser/ui/browser_navigator.h"
40 #include "chrome/browser/ui/browser_navigator_params.h" 40 #include "chrome/browser/ui/browser_navigator_params.h"
41 #include "chrome/browser/ui/browser_tabstrip.h" 41 #include "chrome/browser/ui/browser_tabstrip.h"
42 #include "chrome/browser/ui/tabs/tab_strip_model.h" 42 #include "chrome/browser/ui/tabs/tab_strip_model.h"
43 #include "chrome/common/chrome_paths.h" 43 #include "chrome/common/chrome_paths.h"
44 #include "chrome/common/chrome_switches.h" 44 #include "chrome/common/chrome_switches.h"
45 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
46 #include "chrome/test/base/in_process_browser_test.h" 46 #include "chrome/test/base/in_process_browser_test.h"
47 #include "chrome/test/base/ui_test_utils.h" 47 #include "chrome/test/base/ui_test_utils.h"
48 #include "components/content_settings/core/browser/host_content_settings_map.h" 48 #include "components/content_settings/core/browser/host_content_settings_map.h"
49 #include "components/security_interstitials/core/metrics_helper.h" 49 #include "components/security_interstitials/core/metrics_helper.h"
50 #include "components/security_state/security_state_model.h"
50 #include "components/ssl_errors/error_classification.h" 51 #include "components/ssl_errors/error_classification.h"
51 #include "components/variations/variations_associated_data.h" 52 #include "components/variations/variations_associated_data.h"
52 #include "components/web_modal/web_contents_modal_dialog_manager.h" 53 #include "components/web_modal/web_contents_modal_dialog_manager.h"
53 #include "content/public/browser/browser_context.h" 54 #include "content/public/browser/browser_context.h"
54 #include "content/public/browser/cert_store.h" 55 #include "content/public/browser/cert_store.h"
55 #include "content/public/browser/interstitial_page.h" 56 #include "content/public/browser/interstitial_page.h"
56 #include "content/public/browser/navigation_controller.h" 57 #include "content/public/browser/navigation_controller.h"
57 #include "content/public/browser/navigation_entry.h" 58 #include "content/public/browser/navigation_entry.h"
58 #include "content/public/browser/notification_service.h" 59 #include "content/public/browser/notification_service.h"
59 #include "content/public/browser/render_frame_host.h" 60 #include "content/public/browser/render_frame_host.h"
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 // MarkNonSecureAs field trial is enabled. 1075 // MarkNonSecureAs field trial is enabled.
1075 IN_PROC_BROWSER_TEST_F(SSLUITest, TestMarkNonSecureAs) { 1076 IN_PROC_BROWSER_TEST_F(SSLUITest, TestMarkNonSecureAs) {
1076 scoped_refptr<base::FieldTrial> trial = 1077 scoped_refptr<base::FieldTrial> trial =
1077 base::FieldTrialList::CreateFieldTrial( 1078 base::FieldTrialList::CreateFieldTrial(
1078 "MarkNonSecureAs", switches::kMarkNonSecureAsNonSecure); 1079 "MarkNonSecureAs", switches::kMarkNonSecureAsNonSecure);
1079 1080
1080 content::WebContents* contents = 1081 content::WebContents* contents =
1081 browser()->tab_strip_model()->GetActiveWebContents(); 1082 browser()->tab_strip_model()->GetActiveWebContents();
1082 ASSERT_TRUE(contents); 1083 ASSERT_TRUE(contents);
1083 1084
1084 SecurityStateModel* model = SecurityStateModel::FromWebContents(contents); 1085 ChromeSecurityStateModelDelegate* model_delegate =
1085 ASSERT_TRUE(model); 1086 ChromeSecurityStateModelDelegate::FromWebContents(contents);
1087 ASSERT_TRUE(model_delegate);
1086 1088
1087 ui_test_utils::NavigateToURL(browser(), GURL("file:/")); 1089 ui_test_utils::NavigateToURL(browser(), GURL("file:/"));
1088 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); 1090 EXPECT_EQ(security_state::NONE,
1091 model_delegate->GetSecurityInfo().security_level);
1089 1092
1090 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 1093 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
1091 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); 1094 EXPECT_EQ(security_state::NONE,
1095 model_delegate->GetSecurityInfo().security_level);
1092 1096
1093 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); 1097 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello"));
1094 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); 1098 EXPECT_EQ(security_state::NONE,
1099 model_delegate->GetSecurityInfo().security_level);
1095 1100
1096 ui_test_utils::NavigateToURL( 1101 ui_test_utils::NavigateToURL(
1097 browser(), 1102 browser(),
1098 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); 1103 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a"));
1099 EXPECT_EQ(SecurityStateModel::NONE, model->GetSecurityInfo().security_level); 1104 EXPECT_EQ(security_state::NONE,
1105 model_delegate->GetSecurityInfo().security_level);
1100 } 1106 }
1101 1107
1102 #if defined(USE_NSS_CERTS) 1108 #if defined(USE_NSS_CERTS)
1103 class SSLUITestWithClientCert : public SSLUITest { 1109 class SSLUITestWithClientCert : public SSLUITest {
1104 public: 1110 public:
1105 SSLUITestWithClientCert() : cert_db_(NULL) {} 1111 SSLUITestWithClientCert() : cert_db_(NULL) {}
1106 1112
1107 void SetUpOnMainThread() override { 1113 void SetUpOnMainThread() override {
1108 SSLUITest::SetUpOnMainThread(); 1114 SSLUITest::SetUpOnMainThread();
1109 1115
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 2882
2877 // Visit a page over https that contains a frame with a redirect. 2883 // Visit a page over https that contains a frame with a redirect.
2878 2884
2879 // XMLHttpRequest insecure content in synchronous mode. 2885 // XMLHttpRequest insecure content in synchronous mode.
2880 2886
2881 // XMLHttpRequest insecure content in asynchronous mode. 2887 // XMLHttpRequest insecure content in asynchronous mode.
2882 2888
2883 // XMLHttpRequest over bad ssl in synchronous mode. 2889 // XMLHttpRequest over bad ssl in synchronous mode.
2884 2890
2885 // XMLHttpRequest over OK ssl in synchronous mode. 2891 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/ssl/security_state_model_unittest.cc ('k') | chrome/browser/ui/android/bluetooth_chooser_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698