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 #include <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 #include "components/policy/core/common/external_data_fetcher.h" | 100 #include "components/policy/core/common/external_data_fetcher.h" |
101 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 101 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
102 #include "components/policy/core/common/policy_map.h" | 102 #include "components/policy/core/common/policy_map.h" |
103 #include "components/policy/core/common/policy_pref_names.h" | 103 #include "components/policy/core/common/policy_pref_names.h" |
104 #include "components/policy/core/common/policy_service.h" | 104 #include "components/policy/core/common/policy_service.h" |
105 #include "components/policy/core/common/policy_service_impl.h" | 105 #include "components/policy/core/common/policy_service_impl.h" |
106 #include "components/policy/core/common/policy_types.h" | 106 #include "components/policy/core/common/policy_types.h" |
107 #include "components/search/search.h" | 107 #include "components/search/search.h" |
108 #include "components/search_engines/template_url.h" | 108 #include "components/search_engines/template_url.h" |
109 #include "components/search_engines/template_url_service.h" | 109 #include "components/search_engines/template_url_service.h" |
| 110 #include "components/security_interstitials/core/controller_client.h" |
110 #include "components/ssl_config/ssl_config_prefs.h" | 111 #include "components/ssl_config/ssl_config_prefs.h" |
111 #include "components/translate/core/browser/language_state.h" | 112 #include "components/translate/core/browser/language_state.h" |
112 #include "components/translate/core/browser/translate_infobar_delegate.h" | 113 #include "components/translate/core/browser/translate_infobar_delegate.h" |
113 #include "components/variations/service/variations_service.h" | 114 #include "components/variations/service/variations_service.h" |
114 #include "components/version_info/version_info.h" | 115 #include "components/version_info/version_info.h" |
115 #include "content/public/browser/browser_child_process_host_iterator.h" | 116 #include "content/public/browser/browser_child_process_host_iterator.h" |
116 #include "content/public/browser/browser_context.h" | 117 #include "content/public/browser/browser_context.h" |
117 #include "content/public/browser/browser_thread.h" | 118 #include "content/public/browser/browser_thread.h" |
118 #include "content/public/browser/child_process_data.h" | 119 #include "content/public/browser/child_process_data.h" |
119 #include "content/public/browser/download_item.h" | 120 #include "content/public/browser/download_item.h" |
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3738 const std::string command = base::StringPrintf( | 3739 const std::string command = base::StringPrintf( |
3739 "var node = document.getElementById('extended-reporting-opt-in');" | 3740 "var node = document.getElementById('extended-reporting-opt-in');" |
3740 "if (node) {" | 3741 "if (node) {" |
3741 " window.domAutomationController.send(node.offsetWidth > 0 || " | 3742 " window.domAutomationController.send(node.offsetWidth > 0 || " |
3742 " node.offsetHeight > 0 ? %d : %d);" | 3743 " node.offsetHeight > 0 ? %d : %d);" |
3743 "} else {" | 3744 "} else {" |
3744 // The node should be present but not visible, so trigger an error | 3745 // The node should be present but not visible, so trigger an error |
3745 // by sending false if it's not present. | 3746 // by sending false if it's not present. |
3746 " window.domAutomationController.send(%d);" | 3747 " window.domAutomationController.send(%d);" |
3747 "}", | 3748 "}", |
3748 SecurityInterstitialPage::CMD_TEXT_FOUND, | 3749 security_interstitials::CMD_TEXT_FOUND, |
3749 SecurityInterstitialPage::CMD_TEXT_NOT_FOUND, | 3750 security_interstitials::CMD_TEXT_NOT_FOUND, |
3750 SecurityInterstitialPage::CMD_ERROR); | 3751 security_interstitials::CMD_ERROR); |
3751 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(rvh, command, &result)); | 3752 EXPECT_TRUE(content::ExecuteScriptAndExtractInt(rvh, command, &result)); |
3752 EXPECT_EQ(SecurityInterstitialPage::CMD_TEXT_NOT_FOUND, result); | 3753 EXPECT_EQ(security_interstitials::CMD_TEXT_NOT_FOUND, result); |
3753 } | 3754 } |
3754 | 3755 |
3755 // Test that when SSL error overriding is allowed by policy (default), the | 3756 // Test that when SSL error overriding is allowed by policy (default), the |
3756 // proceed link appears on SSL blocking pages. | 3757 // proceed link appears on SSL blocking pages. |
3757 IN_PROC_BROWSER_TEST_F(PolicyTest, SSLErrorOverridingAllowed) { | 3758 IN_PROC_BROWSER_TEST_F(PolicyTest, SSLErrorOverridingAllowed) { |
3758 net::EmbeddedTestServer https_server_expired( | 3759 net::EmbeddedTestServer https_server_expired( |
3759 net::EmbeddedTestServer::TYPE_HTTPS); | 3760 net::EmbeddedTestServer::TYPE_HTTPS); |
3760 https_server_expired.SetSSLConfig(net::EmbeddedTestServer::CERT_EXPIRED); | 3761 https_server_expired.SetSSLConfig(net::EmbeddedTestServer::CERT_EXPIRED); |
3761 https_server_expired.ServeFilesFromSourceDirectory("chrome/test/data"); | 3762 https_server_expired.ServeFilesFromSourceDirectory("chrome/test/data"); |
3762 ASSERT_TRUE(https_server_expired.Start()); | 3763 ASSERT_TRUE(https_server_expired.Start()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3821 // some other way (e.g., via the keyboard shortcut). | 3822 // some other way (e.g., via the keyboard shortcut). |
3822 content::InterstitialPageDelegate* interstitial_delegate = | 3823 content::InterstitialPageDelegate* interstitial_delegate = |
3823 content::InterstitialPage::GetInterstitialPage( | 3824 content::InterstitialPage::GetInterstitialPage( |
3824 browser()->tab_strip_model()->GetActiveWebContents()) | 3825 browser()->tab_strip_model()->GetActiveWebContents()) |
3825 ->GetDelegateForTesting(); | 3826 ->GetDelegateForTesting(); |
3826 ASSERT_EQ(SSLBlockingPage::kTypeForTesting, | 3827 ASSERT_EQ(SSLBlockingPage::kTypeForTesting, |
3827 interstitial_delegate->GetTypeForTesting()); | 3828 interstitial_delegate->GetTypeForTesting()); |
3828 SSLBlockingPage* ssl_delegate = | 3829 SSLBlockingPage* ssl_delegate = |
3829 static_cast<SSLBlockingPage*>(interstitial_delegate); | 3830 static_cast<SSLBlockingPage*>(interstitial_delegate); |
3830 ssl_delegate->CommandReceived( | 3831 ssl_delegate->CommandReceived( |
3831 base::IntToString(SecurityInterstitialPage::CMD_PROCEED)); | 3832 base::IntToString(security_interstitials::CMD_PROCEED)); |
3832 EXPECT_TRUE(interstitial); | 3833 EXPECT_TRUE(interstitial); |
3833 EXPECT_TRUE(browser() | 3834 EXPECT_TRUE(browser() |
3834 ->tab_strip_model() | 3835 ->tab_strip_model() |
3835 ->GetActiveWebContents() | 3836 ->GetActiveWebContents() |
3836 ->ShowingInterstitialPage()); | 3837 ->ShowingInterstitialPage()); |
3837 } | 3838 } |
3838 | 3839 |
3839 #if !defined(OS_CHROMEOS) | 3840 #if !defined(OS_CHROMEOS) |
3840 // Similar to PolicyTest but sets the proper policy before the browser is | 3841 // Similar to PolicyTest but sets the proper policy before the browser is |
3841 // started. | 3842 // started. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3984 POLICY_SCOPE_USER, | 3985 POLICY_SCOPE_USER, |
3985 POLICY_SOURCE_CLOUD, | 3986 POLICY_SOURCE_CLOUD, |
3986 new base::FundamentalValue(false), | 3987 new base::FundamentalValue(false), |
3987 NULL); | 3988 NULL); |
3988 UpdateProviderPolicy(policies); | 3989 UpdateProviderPolicy(policies); |
3989 EXPECT_FALSE(display_manager->unified_desktop_enabled()); | 3990 EXPECT_FALSE(display_manager->unified_desktop_enabled()); |
3990 } | 3991 } |
3991 #endif // defined(OS_CHROMEOS) | 3992 #endif // defined(OS_CHROMEOS) |
3992 | 3993 |
3993 } // namespace policy | 3994 } // namespace policy |
OLD | NEW |