| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |