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

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: Add test 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..8df425edaf1de34208b228f482255154ee2f14d2 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,27 @@ cr.define('settings_toggle_button', function() {
assertFalse(testElement.$.control.checked);
});
+ test('inverted', function() {
+ testElement.setAttribute('inverted', '');
Dan Beam 2017/03/01 00:27:00 nit: testElement.inverted = true;
stevenjb 2017/03/01 00:35:13 Done.
+ var pref = {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.BOOLEAN,
+ value: true
+ };
+ testElement.set('pref', pref);
Dan Beam 2017/03/01 00:27:00 nit: testElement.set('pref', { key: 'test', t
stevenjb 2017/03/01 00:35:13 Done.
+
+ 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