| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {settings.ImportDataBrowserProxy} | 7 * @implements {settings.ImportDataBrowserProxy} |
| 8 * @extends {settings.TestBrowserProxy} | 8 * @extends {TestBrowserProxy} |
| 9 */ | 9 */ |
| 10 var TestImportDataBrowserProxy = function() { | 10 var TestImportDataBrowserProxy = function() { |
| 11 settings.TestBrowserProxy.call(this, [ | 11 TestBrowserProxy.call(this, [ |
| 12 'initializeImportDialog', | 12 'initializeImportDialog', |
| 13 'importFromBookmarksFile', | 13 'importFromBookmarksFile', |
| 14 'importData', | 14 'importData', |
| 15 ]); | 15 ]); |
| 16 | 16 |
| 17 /** @private {!Array<!settings.BrowserProfile} */ | 17 /** @private {!Array<!settings.BrowserProfile} */ |
| 18 this.browserProfiles_ = []; | 18 this.browserProfiles_ = []; |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 TestImportDataBrowserProxy.prototype = { | 21 TestImportDataBrowserProxy.prototype = { |
| 22 __proto__: settings.TestBrowserProxy.prototype, | 22 __proto__: TestBrowserProxy.prototype, |
| 23 | 23 |
| 24 /** @param {!Array<!settings.BrowserProfile} browserProfiles */ | 24 /** @param {!Array<!settings.BrowserProfile} browserProfiles */ |
| 25 setBrowserProfiles: function(browserProfiles) { | 25 setBrowserProfiles: function(browserProfiles) { |
| 26 this.browserProfiles_ = browserProfiles; | 26 this.browserProfiles_ = browserProfiles; |
| 27 }, | 27 }, |
| 28 | 28 |
| 29 /** @override */ | 29 /** @override */ |
| 30 initializeImportDialog: function() { | 30 initializeImportDialog: function() { |
| 31 this.methodCalled('initializeImportDialog'); | 31 this.methodCalled('initializeImportDialog'); |
| 32 return Promise.resolve(this.browserProfiles_.slice()); | 32 return Promise.resolve(this.browserProfiles_.slice()); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 assertFalse(dialog.$.successIcon.parentElement.hidden); | 189 assertFalse(dialog.$.successIcon.parentElement.hidden); |
| 190 assertTrue(dialog.$$('settings-toggle-button').parentElement.hidden); | 190 assertTrue(dialog.$$('settings-toggle-button').parentElement.hidden); |
| 191 }); | 191 }); |
| 192 }); | 192 }); |
| 193 | 193 |
| 194 test('ImportError', function() { | 194 test('ImportError', function() { |
| 195 simulateImportStatusChange(settings.ImportDataStatus.FAILED); | 195 simulateImportStatusChange(settings.ImportDataStatus.FAILED); |
| 196 assertFalse(dialog.$.dialog.open); | 196 assertFalse(dialog.$.dialog.open); |
| 197 }); | 197 }); |
| 198 }); | 198 }); |
| OLD | NEW |