| 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 29 matching lines...) Expand all Loading... |
| 40 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | 40 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); |
| 41 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 41 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual void SetUpOnMainThread() OVERRIDE { | 44 virtual void SetUpOnMainThread() OVERRIDE { |
| 45 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 46 // Enable web trust certs from policy. | 46 // Enable web trust certs from policy. |
| 47 g_browser_process->browser_policy_connector()-> | 47 g_browser_process->browser_policy_connector()-> |
| 48 GetNetworkConfigurationUpdater()->OnUserPolicyInitialized(true, ""); | 48 GetNetworkConfigurationUpdater()->OnUserPolicyInitialized(true, ""); |
| 49 #endif | 49 #endif |
| 50 content::RunAllPendingInMessageLoop(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 53 void LoadONCPolicy(const std::string& filename) { | 54 void LoadONCPolicy(const std::string& filename) { |
| 54 const std::string& user_policy_blob = | 55 const std::string& user_policy_blob = |
| 55 chromeos::onc::test_utils::ReadTestData(filename); | 56 chromeos::onc::test_utils::ReadTestData(filename); |
| 56 policy::PolicyMap policy; | 57 policy::PolicyMap policy; |
| 57 policy.Set(policy::key::kOpenNetworkConfiguration, | 58 policy.Set(policy::key::kOpenNetworkConfiguration, |
| 58 policy::POLICY_LEVEL_MANDATORY, | 59 policy::POLICY_LEVEL_MANDATORY, |
| 59 policy::POLICY_SCOPE_USER, | 60 policy::POLICY_SCOPE_USER, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // managed setting indicator (only on Chrome OS). | 103 // managed setting indicator (only on Chrome OS). |
| 103 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, | 104 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, |
| 104 PolicyCertificateWithWebTrustHasIndicator) { | 105 PolicyCertificateWithWebTrustHasIndicator) { |
| 105 LoadONCPolicy("certificate-web-authority.onc"); | 106 LoadONCPolicy("certificate-web-authority.onc"); |
| 106 NavigateToSettings(); | 107 NavigateToSettings(); |
| 107 ClickElement("#certificatesManageButton"); | 108 ClickElement("#certificatesManageButton"); |
| 108 ClickElement("#ca-certs-nav-tab"); | 109 ClickElement("#ca-certs-nav-tab"); |
| 109 EXPECT_TRUE(HasElement(".cert-policy")); | 110 EXPECT_TRUE(HasElement(".cert-policy")); |
| 110 } | 111 } |
| 111 #endif | 112 #endif |
| OLD | NEW |