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

Unified Diff: chrome/test/data/webui/settings/settings_toggle_button_tests.js

Issue 2733273002: MD Settings: add extension-control indicator for autofill and password. (Closed)
Patch Set: add tests for settings-toggle-button 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/settings/passwords_and_forms_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/settings_toggle_button_tests.js
diff --git a/chrome/test/data/webui/settings/settings_toggle_button_tests.js b/chrome/test/data/webui/settings/settings_toggle_button_tests.js
index 78770d71afa4de3eca01a9d835ee7d5d29acfc88..5c325393c50c5fb44208a1ee932b25bf0b4383f8 100644
--- a/chrome/test/data/webui/settings/settings_toggle_button_tests.js
+++ b/chrome/test/data/webui/settings/settings_toggle_button_tests.js
@@ -125,7 +125,7 @@ cr.define('settings_toggle_button', function() {
});
test('numerical pref with unknown inital value', function() {
- prefNum = {
+ var prefNum = {
key: 'test',
type: chrome.settingsPrivate.PrefType.NUMBER,
value: 3
@@ -151,6 +151,41 @@ cr.define('settings_toggle_button', function() {
assertTrue(testElement.checked);
assertEquals(1, prefNum.value);
});
+
+ test('shows controlled indicator when pref is controlled', function() {
+ assertFalse(!!testElement.$$('cr-policy-pref-indicator'));
+
+ var pref = {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.NUMBER,
+ value: 3,
+ enforcement: chrome.settingsPrivate.Enforcement.ENFORCED,
+ controlledBy: chrome.settingsPrivate.ControlledBy.EXTENSION
+ };
+
+ testElement.set('pref', pref);
+ Polymer.dom.flush();
+
+ assertTrue(!!testElement.$$('cr-policy-pref-indicator'));
+ });
+
+ test('no indicator with no-extension-indicator flag', function() {
+ assertFalse(!!testElement.$$('cr-policy-pref-indicator'));
+
+ testElement.noExtensionIndicator = true;
+ var pref = {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.NUMBER,
+ value: 3,
+ enforcement: chrome.settingsPrivate.Enforcement.ENFORCED,
+ controlledBy: chrome.settingsPrivate.ControlledBy.EXTENSION
+ };
+
+ testElement.set('pref', pref);
+ Polymer.dom.flush();
+
+ assertFalse(!!testElement.$$('cr-policy-pref-indicator'));
+ });
});
}
« no previous file with comments | « chrome/test/data/webui/settings/passwords_and_forms_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698