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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /** @fileoverview Suite of tests for cr-policy-indicator. */
6 suite('CrPolicyIndicator', function() {
7 /** @type {!CrPolicyIndicatorElement|undefined} */
8 var indicator;
9
10 /** @type {!PaperTooltipElement|undefined} */
11 var tooltip;
12
13 setup(function() {
14 PolymerTest.clearBody();
15
16 indicator = document.createElement('cr-policy-indicator');
17 document.body.appendChild(indicator);
18 tooltip = indicator.$$('paper-tooltip');
19 });
20
21 teardown(function() {
22 PolymerTest.clearBody(); // crbug.com/680169
23 });
24
25 test('none', function() {
26 assertTrue(indicator.$.indicator.hidden);
27 });
28
29 test('indicator', function() {
30 indicator.indicatorType = CrPolicyIndicatorType.USER_POLICY;
31
32 assertFalse(indicator.$.indicator.hidden);
33 assertEquals('cr20:domain', indicator.$.indicator.icon);
34 assertEquals('policy', tooltip.textContent.trim());
35
36 if (cr.isChromeOS) {
37 indicator.indicatorType = CrPolicyIndicatorType.OWNER;
38 indicator.indicatorSourceName = 'foo@example.com';
39
40 assertEquals('cr:person', indicator.$.indicator.icon);
41 assertEquals('owner: foo@example.com', tooltip.textContent.trim());
42 }
43 });
44 });
OLDNEW
« 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