Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8525)

Unified Diff: chrome/test/data/webui/cr_elements/cr_policy_indicator_tests.js

Issue 2744923002: cr-policy-indicator element for non-preference-based indicators (Closed)
Patch Set: alphabetize Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/cr_elements/cr_policy_indicator_tests.js
diff --git a/chrome/test/data/webui/cr_elements/cr_policy_indicator_tests.js b/chrome/test/data/webui/cr_elements/cr_policy_indicator_tests.js
new file mode 100644
index 0000000000000000000000000000000000000000..fbac4f53223913598856472ce5a9670201a5d974
--- /dev/null
+++ b/chrome/test/data/webui/cr_elements/cr_policy_indicator_tests.js
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/** @fileoverview Suite of tests for cr-policy-indicator. */
+suite('CrPolicyIndicator', function() {
+ /** @type {!CrPolicyIndicatorElement|undefined} */
+ var indicator;
+
+ /** @type {!PaperTooltipElement|undefined} */
+ var tooltip;
+
+ setup(function() {
+ PolymerTest.clearBody();
+
+ indicator = document.createElement('cr-policy-indicator');
+ document.body.appendChild(indicator);
+ tooltip = indicator.$$('paper-tooltip');
+ });
+
+ teardown(function() {
+ PolymerTest.clearBody(); // crbug.com/680169
+ });
+
+ test('none', function() {
+ assertTrue(indicator.$.indicator.hidden);
+ });
+
+ test('indicator', function() {
+ indicator.indicatorType = CrPolicyIndicatorType.USER_POLICY;
+
+ assertFalse(indicator.$.indicator.hidden);
+ assertEquals('cr20:domain', indicator.$.indicator.icon);
+ assertEquals('policy', tooltip.textContent.trim());
+
+ if (cr.isChromeOS) {
+ indicator.indicatorType = CrPolicyIndicatorType.OWNER;
+ indicator.indicatorSourceName = 'foo@example.com';
+
+ assertEquals('cr:person', indicator.$.indicator.icon);
+ assertEquals('owner: foo@example.com', tooltip.textContent.trim());
+ }
+ });
+});
« no previous file with comments | « chrome/test/data/webui/cr_elements/cr_elements_browsertest.js ('k') | chrome/test/data/webui/settings/date_time_page_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698