OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/values.h" | 5 #include "base/values.h" |
6 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 6 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
7 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" | 7 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" |
8 #include "components/policy/core/browser/browser_policy_connector.h" | 8 #include "components/policy/core/browser/browser_policy_connector.h" |
9 #include "components/policy/core/common/external_data_fetcher.h" | 9 #include "components/policy/core/common/external_data_fetcher.h" |
10 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 10 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 | 44 |
45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
46 void LoadONCPolicy(const std::string& filename) { | 46 void LoadONCPolicy(const std::string& filename) { |
47 const std::string& user_policy_blob = | 47 const std::string& user_policy_blob = |
48 chromeos::onc::test_utils::ReadTestData(filename); | 48 chromeos::onc::test_utils::ReadTestData(filename); |
49 policy::PolicyMap policy; | 49 policy::PolicyMap policy; |
50 policy.Set(policy::key::kOpenNetworkConfiguration, | 50 policy.Set(policy::key::kOpenNetworkConfiguration, |
51 policy::POLICY_LEVEL_MANDATORY, | 51 policy::POLICY_LEVEL_MANDATORY, |
52 policy::POLICY_SCOPE_USER, | 52 policy::POLICY_SCOPE_USER, |
53 policy::POLICY_SOURCE_CLOUD, | |
54 new base::StringValue(user_policy_blob), | 53 new base::StringValue(user_policy_blob), |
55 NULL); | 54 NULL); |
56 provider_.UpdateChromePolicy(policy); | 55 provider_.UpdateChromePolicy(policy); |
57 content::RunAllPendingInMessageLoop(); | 56 content::RunAllPendingInMessageLoop(); |
58 } | 57 } |
59 #endif | 58 #endif |
60 | 59 |
61 void ClickElement(const std::string& selector) { | 60 void ClickElement(const std::string& selector) { |
62 EXPECT_TRUE(content::ExecuteScript( | 61 EXPECT_TRUE(content::ExecuteScript( |
63 GetSettingsFrame(), | 62 GetSettingsFrame(), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // managed setting indicator (only on Chrome OS). | 97 // managed setting indicator (only on Chrome OS). |
99 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, | 98 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, |
100 PolicyCertificateWithWebTrustHasIndicator) { | 99 PolicyCertificateWithWebTrustHasIndicator) { |
101 LoadONCPolicy("certificate-web-authority.onc"); | 100 LoadONCPolicy("certificate-web-authority.onc"); |
102 NavigateToSettings(); | 101 NavigateToSettings(); |
103 ClickElement("#certificatesManageButton"); | 102 ClickElement("#certificatesManageButton"); |
104 ClickElement("#ca-certs-nav-tab"); | 103 ClickElement("#ca-certs-nav-tab"); |
105 EXPECT_TRUE(HasElement(".cert-policy")); | 104 EXPECT_TRUE(HasElement(".cert-policy")); |
106 } | 105 } |
107 #endif | 106 #endif |
OLD | NEW |