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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/radio_group_tests.js
diff --git a/chrome/test/data/webui/settings/radio_group_tests.js b/chrome/test/data/webui/settings/radio_group_tests.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c8083fe0bdfd30054db4c535607df22b6ba90f1
--- /dev/null
+++ b/chrome/test/data/webui/settings/radio_group_tests.js
@@ -0,0 +1,47 @@
+// Copyright 2016 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.
+
+suite('SettingsRadioGroup', function() {
+ /**
+ * Checkbox created before each test.
+ * @type {SettingsRadioGroup}
+ */
+ var testElement;
+
+ /**
+ * Pref value used in tests, should reflect checkbox 'checked' attribute.
+ * @type {PrefObject}
+ */
+ var pref = {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.BOOLEAN,
+ value: true
+ };
+
+ suiteSetup(function() {
+ return PolymerTest.importHtml('chrome://resources/polymer/v1_0/' +
+ 'paper-radio-button/paper-radio-button.html');
+ });
+
+ setup(function() {
+ PolymerTest.clearBody();
+ testElement = document.createElement('settings-radio-group');
+ testElement.set('pref', pref);
+ document.body.appendChild(testElement);
+ });
+
+ test('disables paper-radio-buttons when managed', function() {
+ testElement.appendChild(document.createElement('paper-radio-button'));
+
+ assertEquals('PAPER-RADIO-BUTTON', testElement.firstChild.tagName);
+ assertFalse(testElement.firstChild.disabled);
+
+ testElement.set('pref.policyEnforcement',
+ chrome.settingsPrivate.PolicyEnforcement.ENFORCED);
+ assertTrue(testElement.firstChild.disabled);
+
+ testElement.set('pref.policyEnforcement', undefined);
+ assertFalse(testElement.firstChild.disabled);
+ });
+});
« 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