| 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 {settings.TestBrowserProxy} |
| 9 */ | 9 */ |
| 10 var TestImportDataBrowserProxy = function() { | 10 var TestImportDataBrowserProxy = function() { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 var dialog = null; | 88 var dialog = null; |
| 89 | 89 |
| 90 setup(function() { | 90 setup(function() { |
| 91 browserProxy = new TestImportDataBrowserProxy(); | 91 browserProxy = new TestImportDataBrowserProxy(); |
| 92 browserProxy.setBrowserProfiles(browserProfiles); | 92 browserProxy.setBrowserProfiles(browserProfiles); |
| 93 settings.ImportDataBrowserProxyImpl.instance_ = browserProxy; | 93 settings.ImportDataBrowserProxyImpl.instance_ = browserProxy; |
| 94 PolymerTest.clearBody(); | 94 PolymerTest.clearBody(); |
| 95 dialog = document.createElement('settings-import-data-dialog'); | 95 dialog = document.createElement('settings-import-data-dialog'); |
| 96 dialog.set('prefs', prefs); | 96 dialog.set('prefs', prefs); |
| 97 document.body.appendChild(dialog); | 97 document.body.appendChild(dialog); |
| 98 assertTrue(dialog.$.dialog.open); | |
| 99 return browserProxy.whenCalled('initializeImportDialog').then(function() { | 98 return browserProxy.whenCalled('initializeImportDialog').then(function() { |
| 99 assertTrue(dialog.$.dialog.open); |
| 100 Polymer.dom.flush(); | 100 Polymer.dom.flush(); |
| 101 }); | 101 }); |
| 102 }); | 102 }); |
| 103 | 103 |
| 104 function simulateBrowserProfileChange(index) { | 104 function simulateBrowserProfileChange(index) { |
| 105 dialog.$.browserSelect.selectedIndex = index; | 105 dialog.$.browserSelect.selectedIndex = index; |
| 106 dialog.$.browserSelect.dispatchEvent(new CustomEvent('change')); | 106 dialog.$.browserSelect.dispatchEvent(new CustomEvent('change')); |
| 107 } | 107 } |
| 108 | 108 |
| 109 test('Initialization', function() { | 109 test('Initialization', function() { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 assertFalse(dialog.$.successIcon.parentElement.hidden); | 192 assertFalse(dialog.$.successIcon.parentElement.hidden); |
| 193 assertTrue(dialog.$$('settings-toggle-button').parentElement.hidden); | 193 assertTrue(dialog.$$('settings-toggle-button').parentElement.hidden); |
| 194 }); | 194 }); |
| 195 }); | 195 }); |
| 196 | 196 |
| 197 test('ImportError', function() { | 197 test('ImportError', function() { |
| 198 simulateImportStatusChange(settings.ImportDataStatus.FAILED); | 198 simulateImportStatusChange(settings.ImportDataStatus.FAILED); |
| 199 assertFalse(dialog.$.dialog.open); | 199 assertFalse(dialog.$.dialog.open); |
| 200 }); | 200 }); |
| 201 }); | 201 }); |
| OLD | NEW |