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/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/policy/browser_policy_connector.h" | 7 #include "chrome/browser/policy/browser_policy_connector.h" |
8 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 8 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
9 #include "chrome/browser/policy/policy_map.h" | 9 #include "chrome/browser/policy/policy_map.h" |
10 #include "chrome/browser/policy/policy_types.h" | 10 #include "chrome/browser/policy/policy_types.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
48 Profile* profile = browser()->profile(); | 48 Profile* profile = browser()->profile(); |
49 policy::ProfilePolicyConnector* connector = | 49 policy::ProfilePolicyConnector* connector = |
50 policy::ProfilePolicyConnectorFactory::GetForProfile(profile); | 50 policy::ProfilePolicyConnectorFactory::GetForProfile(profile); |
51 | 51 |
52 // Enable web trust certs from policy. | 52 // Enable web trust certs from policy. |
53 g_browser_process->browser_policy_connector()-> | 53 g_browser_process->browser_policy_connector()-> |
54 GetNetworkConfigurationUpdater()->SetUserPolicyService( | 54 GetNetworkConfigurationUpdater()->SetUserPolicyService( |
55 true, "", connector->policy_service()); | 55 true, "", connector->policy_service()); |
56 #endif | 56 #endif |
| 57 content::RunAllPendingInMessageLoop(); |
57 } | 58 } |
58 | 59 |
59 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
60 void LoadONCPolicy(const std::string& filename) { | 61 void LoadONCPolicy(const std::string& filename) { |
61 const std::string& user_policy_blob = | 62 const std::string& user_policy_blob = |
62 chromeos::onc::test_utils::ReadTestData(filename); | 63 chromeos::onc::test_utils::ReadTestData(filename); |
63 policy::PolicyMap policy; | 64 policy::PolicyMap policy; |
64 policy.Set(policy::key::kOpenNetworkConfiguration, | 65 policy.Set(policy::key::kOpenNetworkConfiguration, |
65 policy::POLICY_LEVEL_MANDATORY, | 66 policy::POLICY_LEVEL_MANDATORY, |
66 policy::POLICY_SCOPE_USER, | 67 policy::POLICY_SCOPE_USER, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // managed setting indicator (only on Chrome OS). | 110 // managed setting indicator (only on Chrome OS). |
110 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, | 111 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, |
111 PolicyCertificateWithWebTrustHasIndicator) { | 112 PolicyCertificateWithWebTrustHasIndicator) { |
112 LoadONCPolicy("certificate-web-authority.onc"); | 113 LoadONCPolicy("certificate-web-authority.onc"); |
113 NavigateToSettings(); | 114 NavigateToSettings(); |
114 ClickElement("#certificatesManageButton"); | 115 ClickElement("#certificatesManageButton"); |
115 ClickElement("#ca-certs-nav-tab"); | 116 ClickElement("#ca-certs-nav-tab"); |
116 EXPECT_TRUE(HasElement(".cert-policy")); | 117 EXPECT_TRUE(HasElement(".cert-policy")); |
117 } | 118 } |
118 #endif | 119 #endif |
OLD | NEW |