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

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

Issue 2727513002: Revert of MD Settings: Stop using prefs to populate import data dialog. (Closed)
Patch Set: 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/people_page/import_data_dialog.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/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);
« no previous file with comments | « chrome/browser/resources/settings/people_page/import_data_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698