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

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

Issue 2596083002: MD Settings: Defer opening Import Dialog dialog to prevent UI flicker (Closed)
Patch Set: Update test Created 4 years 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
« no previous file with comments | « chrome/browser/resources/settings/people_page/import_data_dialog.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 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
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/import_data_dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698