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

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

Issue 1486953003: Support numbers in settings-checkbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Feedback Created 5 years 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_checkbox.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/checkbox_tests.js
diff --git a/chrome/test/data/webui/settings/checkbox_tests.js b/chrome/test/data/webui/settings/checkbox_tests.js
index 88b0e5fdc2e441dc60b0cfdc0ff14ec94355e1f4..1e63e6885c73b27ec677c08993cb10332df58265 100644
--- a/chrome/test/data/webui/settings/checkbox_tests.js
+++ b/chrome/test/data/webui/settings/checkbox_tests.js
@@ -66,6 +66,25 @@ cr.define('settings_checkbox', function() {
assertFalse(testElement.checked);
assertFalse(testElement.$.checkbox.checked);
});
+
+ test('numerical pref', function() {
+ var prefNum = {
+ key: 'test',
+ type: chrome.settingsPrivate.PrefType.NUMBER,
+ value: 1
+ };
+
+ testElement.set('pref', prefNum);
+ assertTrue(testElement.checked);
+
+ testElement.removeAttribute('checked');
+ assertFalse(testElement.checked);
+ assertEquals(0, prefNum.value);
+
+ testElement.setAttribute('checked', '');
+ assertTrue(testElement.checked);
+ assertEquals(1, prefNum.value);
+ });
});
}
« no previous file with comments | « chrome/browser/resources/settings/controls/settings_checkbox.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698