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

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

Issue 2617533003: MD Settings: change most checkboxes to toggles (leave dialogs alone) (Closed)
Patch Set: fix tests Created 3 years, 11 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
Index: chrome/test/data/webui/settings/people_page_sync_page_test.js
diff --git a/chrome/test/data/webui/settings/people_page_sync_page_test.js b/chrome/test/data/webui/settings/people_page_sync_page_test.js
index c4a0e80866b69490cb8d303545b07bf7f96a848d..b8cd5c48b887e581507ddeced25f19dbf6f08b1e 100644
--- a/chrome/test/data/webui/settings/people_page_sync_page_test.js
+++ b/chrome/test/data/webui/settings/people_page_sync_page_test.js
@@ -196,21 +196,21 @@ cr.define('settings_people_page_sync_page', function() {
});
test('SettingIndividualDatatypes', function() {
- var syncAllDataTypesCheckbox = syncPage.$.syncAllDataTypesCheckbox;
- assertFalse(syncAllDataTypesCheckbox.disabled);
- assertTrue(syncAllDataTypesCheckbox.checked);
+ var syncAllDataTypesControl = syncPage.$.syncAllDataTypesControl;
+ assertFalse(syncAllDataTypesControl.disabled);
+ assertTrue(syncAllDataTypesControl.checked);
- // Assert that all the individual datatype checkboxes are disabled.
- var datatypeCheckboxes = syncPage
+ // Assert that all the individual datatype controls are disabled.
+ var datatypeControls = syncPage
.$$('#configure')
- .querySelectorAll('paper-checkbox.list-item');
- for (var box of datatypeCheckboxes) {
- assertTrue(box.disabled);
- assertTrue(box.checked);
+ .querySelectorAll('.list-item paper-toggle-button');
+ for (var control of datatypeControls) {
+ assertTrue(control.disabled);
+ assertTrue(control.checked);
}
- // Uncheck the Sync All checkbox.
- MockInteractions.tap(syncAllDataTypesCheckbox);
+ // Uncheck the Sync All control.
+ MockInteractions.tap(syncAllDataTypesControl);
function verifyPrefs(prefs) {
var expected = getSyncAllPrefs();
@@ -219,16 +219,16 @@ cr.define('settings_people_page_sync_page', function() {
cr.webUIListenerCallback('sync-prefs-changed', expected);
- // Assert that all the individual datatype checkboxes are enabled.
- for (var box of datatypeCheckboxes) {
- assertFalse(box.disabled);
- assertTrue(box.checked);
+ // Assert that all the individual datatype controls are enabled.
+ for (var control of datatypeControls) {
+ assertFalse(control.disabled);
+ assertTrue(control.checked);
}
browserProxy.resetResolver('setSyncDatatypes');
- // Test an arbitrarily-selected checkbox (extensions synced checkbox).
- MockInteractions.tap(datatypeCheckboxes[3]);
+ // Test an arbitrarily-selected control (extensions synced control).
+ MockInteractions.tap(datatypeControls[3]);
return browserProxy.whenCalled('setSyncDatatypes').then(
function(prefs) {
var expected = getSyncAllPrefs();
@@ -240,30 +240,6 @@ cr.define('settings_people_page_sync_page', function() {
return browserProxy.whenCalled('setSyncDatatypes').then(verifyPrefs);
});
- test('ClickingLinkDoesNotChangeCheckboxValue', function() {
- var syncAllDataTypesCheckbox = syncPage.$.syncAllDataTypesCheckbox;
-
- // Uncheck the Sync All checkbox.
- MockInteractions.tap(syncAllDataTypesCheckbox);
-
- // Make sure the checkbox is enabled and checked.
- var link = syncPage.$.paymentLearnMore;
-
- // Suppress opening a new tab, since then the test will continue running
- // on a background tab (which has throttled timers) and will timeout.
- link.target = '';
- link.href = '#';
-
- assertEquals('PAPER-CHECKBOX', link.parentNode.nodeName);
- assertFalse(link.parentNode.disabled);
- assertTrue(link.parentNode.checked);
-
- MockInteractions.tap(link);
-
- // The checkbox value should be unchanged after clicking on the link.
- assertTrue(link.parentNode.checked);
- });
-
test('RadioBoxesEnabledWhenUnencrypted', function() {
// Verify that the encryption radio boxes are enabled.
assertFalse(encryptWithGoogle.disabled);
« no previous file with comments | « chrome/test/data/webui/settings/metrics_reporting_tests.js ('k') | chrome/test/data/webui/settings/privacy_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698