Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 suite('controlled button', function() { | |
| 6 /** @type {ControlledButtonElement} */ | |
| 7 var button; | |
| 8 | |
| 9 /** @type {!chrome.settingsPrivate.PrefObject} */ | |
| 10 var pref = { | |
| 11 key: 'test', | |
| 12 type: chrome.settingsPrivate.PrefType.BOOLEAN, | |
| 13 value: true | |
| 14 }; | |
| 15 | |
| 16 setup(function() { | |
| 17 PolymerTest.clearBody(); | |
| 18 button = document.createElement('controlled-button'); | |
| 19 button.set('pref', pref); | |
|
michaelpg
2016/08/04 17:54:23
button.pref = pref
Dan Beam
2016/08/04 22:26:42
Done.
| |
| 20 document.body.appendChild(button); | |
| 21 }); | |
| 22 | |
| 23 test('disables when pref is managed', function() { | |
| 24 button.set('pref.policyEnforcement', | |
| 25 chrome.settingsPrivate.PolicyEnforcement.ENFORCED); | |
| 26 Polymer.dom.flush(); | |
| 27 assertTrue(button.$$('paper-button').disabled); | |
| 28 assertTrue(!!button.$$('cr-policy-pref-indicator')); | |
|
michaelpg
2016/08/04 17:54:23
check clientHeight > 0
Dan Beam
2016/08/04 22:26:42
Done.
| |
| 29 | |
| 30 button.set('pref.policyEnforcement', undefined); | |
| 31 Polymer.dom.flush(); | |
| 32 assertFalse(button.$$('paper-button').disabled); | |
| 33 assertEquals('none', button.$$('cr-policy-pref-indicator').style.display); | |
|
michaelpg
2016/08/04 17:54:23
i'd suggest the same here... this is implementatio
Dan Beam
2016/08/04 22:26:42
Done.
| |
| 34 }); | |
| 35 }); | |
| OLD | NEW |