| OLD | NEW |
| (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 }); |
| OLD | NEW |