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

Side by Side Diff: chrome/test/data/webui/settings/radio_group_tests.js

Issue 2052543002: MD Settings: disable <paper-radio-button>s inside of a <settings-radio-group> when controlled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asdf Created 4 years, 6 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
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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('SettingsRadioGroup', function() {
6 /**
7 * Checkbox created before each test.
8 * @type {SettingsRadioGroup}
9 */
10 var testElement;
11
12 /**
13 * Pref value used in tests, should reflect checkbox 'checked' attribute.
14 * @type {PrefObject}
15 */
16 var pref = {
17 key: 'test',
18 type: chrome.settingsPrivate.PrefType.BOOLEAN,
19 value: true
20 };
21
22 suiteSetup(function() {
23 return PolymerTest.importHtml('chrome://resources/polymer/v1_0/' +
24 'paper-radio-button/paper-radio-button.html');
25 });
26
27 setup(function() {
28 PolymerTest.clearBody();
29 testElement = document.createElement('settings-radio-group');
30 testElement.set('pref', pref);
31 document.body.appendChild(testElement);
32 });
33
34 test('disables paper-radio-buttons when managed', function() {
35 testElement.appendChild(document.createElement('paper-radio-button'));
36
37 assertEquals('PAPER-RADIO-BUTTON', testElement.firstChild.tagName);
38 assertFalse(testElement.firstChild.disabled);
39
40 testElement.set('pref.policyEnforcement',
41 chrome.settingsPrivate.PolicyEnforcement.ENFORCED);
42 assertTrue(testElement.firstChild.disabled);
43
44 testElement.set('pref.policyEnforcement', undefined);
45 assertFalse(testElement.firstChild.disabled);
46 });
47 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698