| 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" | 10 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 new chromeos::onc::CertificateImporterImpl(database))); | 130 new chromeos::onc::CertificateImporterImpl(database))); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void LoadONCPolicy(const std::string& filename) { | 133 void LoadONCPolicy(const std::string& filename) { |
| 134 const std::string& user_policy_blob = | 134 const std::string& user_policy_blob = |
| 135 chromeos::onc::test_utils::ReadTestData(filename); | 135 chromeos::onc::test_utils::ReadTestData(filename); |
| 136 policy::PolicyMap policy; | 136 policy::PolicyMap policy; |
| 137 policy.Set(policy::key::kOpenNetworkConfiguration, | 137 policy.Set(policy::key::kOpenNetworkConfiguration, |
| 138 policy::POLICY_LEVEL_MANDATORY, | 138 policy::POLICY_LEVEL_MANDATORY, |
| 139 policy::POLICY_SCOPE_USER, | 139 policy::POLICY_SCOPE_USER, |
| 140 base::Value::CreateStringValue(user_policy_blob), | 140 new base::StringValue(user_policy_blob), |
| 141 NULL); | 141 NULL); |
| 142 provider_.UpdateChromePolicy(policy); | 142 provider_.UpdateChromePolicy(policy); |
| 143 content::RunAllPendingInMessageLoop(); | 143 content::RunAllPendingInMessageLoop(); |
| 144 } | 144 } |
| 145 #endif | 145 #endif |
| 146 | 146 |
| 147 void ClickElement(const std::string& selector) { | 147 void ClickElement(const std::string& selector) { |
| 148 EXPECT_TRUE(content::ExecuteScript( | 148 EXPECT_TRUE(content::ExecuteScript( |
| 149 GetSettingsFrame(), | 149 GetSettingsFrame(), |
| 150 "document.querySelector(\"" + selector + "\").click()")); | 150 "document.querySelector(\"" + selector + "\").click()")); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // managed setting indicator (only on Chrome OS). | 185 // managed setting indicator (only on Chrome OS). |
| 186 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, | 186 IN_PROC_BROWSER_TEST_F(CertificateManagerBrowserTest, |
| 187 PolicyCertificateWithWebTrustHasIndicator) { | 187 PolicyCertificateWithWebTrustHasIndicator) { |
| 188 LoadONCPolicy("certificate-web-authority.onc"); | 188 LoadONCPolicy("certificate-web-authority.onc"); |
| 189 NavigateToSettings(); | 189 NavigateToSettings(); |
| 190 ClickElement("#certificatesManageButton"); | 190 ClickElement("#certificatesManageButton"); |
| 191 ClickElement("#ca-certs-nav-tab"); | 191 ClickElement("#ca-certs-nav-tab"); |
| 192 EXPECT_TRUE(HasElement(".cert-policy")); | 192 EXPECT_TRUE(HasElement(".cert-policy")); |
| 193 } | 193 } |
| 194 #endif | 194 #endif |
| OLD | NEW |