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

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

Issue 2718253006: MD Settings: checkbox: Support inverted when setting pref (Closed)
Patch Set: Rebase Created 3 years, 10 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/browser/resources/settings/controls/settings_boolean_control_behavior.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 151dfa9d4a72241fe8be67141c53cfdde2d400d2..78770d71afa4de3eca01a9d835ee7d5d29acfc88 100644
--- a/chrome/test/data/webui/settings/settings_toggle_button_tests.js
+++ b/chrome/test/data/webui/settings/settings_toggle_button_tests.js
@@ -64,6 +64,26 @@ cr.define('settings_toggle_button', function() {
assertFalse(testElement.$.control.checked);
});
+ test('inverted', function() {
+ testElement.inverted = true;
+ testElement.set('pref', {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.BOOLEAN,
+ value: true
+ });
+
+ assertTrue(testElement.pref.value);
+ assertFalse(testElement.checked);
+
+ MockInteractions.tap(testElement.$.control);
+ assertFalse(testElement.pref.value);
+ assertTrue(testElement.checked);
+
+ MockInteractions.tap(testElement.$.control);
+ assertTrue(testElement.pref.value);
+ assertFalse(testElement.checked);
+ });
+
test('numerical pref', function() {
var prefNum = {
key: 'test',
« no previous file with comments | « chrome/browser/resources/settings/controls/settings_boolean_control_behavior.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698