| 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 base::Value::CreateStringValue(user_policy_blob), | 53 new base::StringValue(user_policy_blob), |
| 54 NULL); | 54 NULL); |
| 55 provider_.UpdateChromePolicy(policy); | 55 provider_.UpdateChromePolicy(policy); |
| 56 content::RunAllPendingInMessageLoop(); | 56 content::RunAllPendingInMessageLoop(); |
| 57 } | 57 } |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 void ClickElement(const std::string& selector) { | 60 void ClickElement(const std::string& selector) { |
| 61 EXPECT_TRUE(content::ExecuteScript( | 61 EXPECT_TRUE(content::ExecuteScript( |
| 62 GetSettingsFrame(), | 62 GetSettingsFrame(), |
| 63 "document.querySelector(\"" + selector + "\").click()")); | 63 "document.querySelector(\"" + selector + "\").click()")); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // managed setting indicator (only on Chrome OS). | 97 // managed setting indicator (only on Chrome OS). |
| 98 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, | 98 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, |
| 99 PolicyCertificateWithWebTrustHasIndicator) { | 99 PolicyCertificateWithWebTrustHasIndicator) { |
| 100 LoadONCPolicy("certificate-web-authority.onc"); | 100 LoadONCPolicy("certificate-web-authority.onc"); |
| 101 NavigateToSettings(); | 101 NavigateToSettings(); |
| 102 ClickElement("#certificatesManageButton"); | 102 ClickElement("#certificatesManageButton"); |
| 103 ClickElement("#ca-certs-nav-tab"); | 103 ClickElement("#ca-certs-nav-tab"); |
| 104 EXPECT_TRUE(HasElement(".cert-policy")); | 104 EXPECT_TRUE(HasElement(".cert-policy")); |
| 105 } | 105 } |
| 106 #endif | 106 #endif |
| OLD | NEW |