| 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 Autofill Settings tests. */ | 5 /** @fileoverview Runs the Polymer Autofill Settings 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 }, | 119 }, |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Creates the autofill section for the given lists. | 122 * Creates the autofill section for the given lists. |
| 123 * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList | 123 * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList |
| 124 * @param {!Array<!chrome.passwordsPrivate.ExceptionPair>} exceptionList | 124 * @param {!Array<!chrome.passwordsPrivate.ExceptionPair>} exceptionList |
| 125 * @return {!Object} | 125 * @return {!Object} |
| 126 * @private | 126 * @private |
| 127 */ | 127 */ |
| 128 createAutofillSection_: function(addresses, creditCards) { | 128 createAutofillSection_: function(addresses, creditCards) { |
| 129 // Override the AutofillManagerImpl for testing. |
| 130 this.autofillManager = new TestAutofillManager(); |
| 131 this.autofillManager.data.addresses = addresses; |
| 132 this.autofillManager.data.creditCards = creditCards; |
| 133 AutofillManagerImpl.instance_ = this.autofillManager; |
| 134 |
| 129 var section = document.createElement('settings-autofill-section'); | 135 var section = document.createElement('settings-autofill-section'); |
| 130 section.addresses = addresses; | |
| 131 section.creditCards = creditCards; | |
| 132 document.body.appendChild(section); | 136 document.body.appendChild(section); |
| 133 Polymer.dom.flush(); | 137 Polymer.dom.flush(); |
| 134 return section; | 138 return section; |
| 135 }, | 139 }, |
| 136 | 140 |
| 137 /** | 141 /** |
| 138 * Creates the Edit Address dialog and fulfills the promise when the dialog | 142 * Creates the Edit Address dialog and fulfills the promise when the dialog |
| 139 * has actually opened. | 143 * has actually opened. |
| 140 * @param {!chrome.autofillPrivate.AddressEntry} address | 144 * @param {!chrome.autofillPrivate.AddressEntry} address |
| 141 * @return {!Promise<Object>} | 145 * @return {!Promise<Object>} |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 assertEquals(city, cols[0].value); | 847 assertEquals(city, cols[0].value); |
| 844 assertEquals(state, cols[1].value); | 848 assertEquals(state, cols[1].value); |
| 845 assertEquals(zip, cols[2].value); | 849 assertEquals(zip, cols[2].value); |
| 846 }); | 850 }); |
| 847 }); | 851 }); |
| 848 }); | 852 }); |
| 849 }); | 853 }); |
| 850 | 854 |
| 851 mocha.run(); | 855 mocha.run(); |
| 852 }); | 856 }); |
| OLD | NEW |