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

Side by Side Diff: chrome/test/data/webui/settings/passwords_and_forms_browsertest.js

Issue 2254113002: MD Settings: reduce complexity and overhead of prefs singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SimplifyLanguages
Patch Set: Nit Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @fileoverview Runs the Polymer Passwords and Forms tests. */ 5 /** @fileoverview Runs the Polymer Passwords and Forms tests. */
6 6
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 /** 263 /**
264 * @pram {boolean} autofill Whether autofill is enabled or not. 264 * @pram {boolean} autofill Whether autofill is enabled or not.
265 * @param {boolean} passwords Whether passwords are enabled or not. 265 * @param {boolean} passwords Whether passwords are enabled or not.
266 * @return {!Promise<!Element>} The |prefs| object. 266 * @return {!Promise<!Element>} The |prefs| object.
267 */ 267 */
268 createPrefs: function(autofill, passwords) { 268 createPrefs: function(autofill, passwords) {
269 return new Promise(function(resolve) { 269 return new Promise(function(resolve) {
270 CrSettingsPrefs.deferInitialization = true; 270 CrSettingsPrefs.deferInitialization = true;
271 var prefs = document.createElement('settings-prefs'); 271 var prefs = document.createElement('settings-prefs');
272 document.body.appendChild(prefs); 272 prefs.initialize(new settings.FakeSettingsPrivate([
273 prefs.initializeForTesting(new settings.FakeSettingsPrivate([
274 { 273 {
275 key: 'autofill.enabled', 274 key: 'autofill.enabled',
276 type: chrome.settingsPrivate.PrefType.BOOLEAN, 275 type: chrome.settingsPrivate.PrefType.BOOLEAN,
277 value: autofill, 276 value: autofill,
278 }, 277 },
279 { 278 {
280 key: 'profile.password_manager_enabled', 279 key: 'profile.password_manager_enabled',
281 type: chrome.settingsPrivate.PrefType.BOOLEAN, 280 type: chrome.settingsPrivate.PrefType.BOOLEAN,
282 value: passwords, 281 value: passwords,
283 }, 282 },
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 assertTrue(element.$.autofillManagerButton.hasAttribute('actionable')); 441 assertTrue(element.$.autofillManagerButton.hasAttribute('actionable'));
443 assertTrue(element.$.passwordManagerButton.hasAttribute('actionable')); 442 assertTrue(element.$.passwordManagerButton.hasAttribute('actionable'));
444 443
445 self.destroyPrefs(prefs); 444 self.destroyPrefs(prefs);
446 }); 445 });
447 }); 446 });
448 }); 447 });
449 448
450 mocha.run(); 449 mocha.run();
451 }); 450 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/languages_tests.js ('k') | chrome/test/data/webui/settings/prefs_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698