| Index: chrome/test/data/webui/settings/import_data_dialog_test.js
|
| diff --git a/chrome/test/data/webui/settings/import_data_dialog_test.js b/chrome/test/data/webui/settings/import_data_dialog_test.js
|
| index 595b67a0c897d12a191f09ce5e81cab729219082..d053879752555a9328736123f3613e9e617af045 100644
|
| --- a/chrome/test/data/webui/settings/import_data_dialog_test.js
|
| +++ b/chrome/test/data/webui/settings/import_data_dialog_test.js
|
| @@ -74,6 +74,17 @@
|
| };
|
| }
|
|
|
| + var prefs = {};
|
| + [
|
| + 'import_history',
|
| + 'import_bookmarks',
|
| + 'import_saved_passwords',
|
| + 'import_search_engine',
|
| + 'import_autofill_form_data',
|
| + ].forEach(function(name) {
|
| + prefs[name] = createBooleanPref(name);
|
| + });
|
| +
|
| var dialog = null;
|
|
|
| setup(function() {
|
| @@ -82,6 +93,7 @@
|
| settings.ImportDataBrowserProxyImpl.instance_ = browserProxy;
|
| PolymerTest.clearBody();
|
| dialog = document.createElement('settings-import-data-dialog');
|
| + dialog.set('prefs', prefs);
|
| document.body.appendChild(dialog);
|
| return browserProxy.whenCalled('initializeImportDialog').then(function() {
|
| assertTrue(dialog.$.dialog.open);
|
| @@ -106,28 +118,21 @@
|
| test('ImportButton', function() {
|
| assertFalse(dialog.$.import.disabled);
|
|
|
| - var checkboxes = dialog.shadowRoot.querySelectorAll('paper-checkbox');
|
| - assertEquals(5, checkboxes.length);
|
| -
|
| - checkboxes.forEach(function(checkbox) {
|
| - checkbox.checked = false;
|
| - });
|
| - checkboxes[0].fire('change');
|
| + // Flip all prefs to false.
|
| + Object.keys(prefs).forEach(function(prefName) {
|
| + dialog.set('prefs.' + prefName + '.value', false);
|
| + });
|
| assertTrue(dialog.$.import.disabled);
|
|
|
| // Change browser selection to "Import from Bookmarks HTML file".
|
| simulateBrowserProfileChange(1);
|
| assertTrue(dialog.$.import.disabled);
|
|
|
| - // Ensure everything except |favorites| is ignored.
|
| - var history = dialog.$$('#history');
|
| - history.checked = true;
|
| - history.fire('change');
|
| - assertTrue(dialog.$.import.disabled);
|
| -
|
| - var favorites = dialog.$$('#favorites');
|
| - favorites.checked = true;
|
| - favorites.fire('change');
|
| + // Ensure everything except |import_bookmarks| is ignored.
|
| + dialog.set('prefs.import_history.value', true);
|
| + assertTrue(dialog.$.import.disabled);
|
| +
|
| + dialog.set('prefs.import_bookmarks.value', true);
|
| assertFalse(dialog.$.import.disabled);
|
| });
|
|
|
| @@ -170,7 +175,7 @@
|
| });
|
|
|
| test('ImportFromBrowserProfile', function() {
|
| - dialog.$.favorites.checked = false;
|
| + dialog.set('prefs.import_bookmarks.value', false);
|
|
|
| var expectedIndex = 0;
|
| simulateBrowserProfileChange(expectedIndex);
|
|
|