| 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 cr.define('settings_people_page', function() { | 5 cr.define('settings_people_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.ProfileInfoBrowserProxy} | 8 * @implements {settings.ProfileInfoBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 Polymer.dom.flush(); | 159 Polymer.dom.flush(); |
| 160 | 160 |
| 161 assertTrue(peoplePage.$.disconnectDialog.open); | 161 assertTrue(peoplePage.$.disconnectDialog.open); |
| 162 assertFalse(peoplePage.$.deleteProfile.hidden); | 162 assertFalse(peoplePage.$.deleteProfile.hidden); |
| 163 | 163 |
| 164 var disconnectConfirm = peoplePage.$.disconnectConfirm; | 164 var disconnectConfirm = peoplePage.$.disconnectConfirm; |
| 165 assertTrue(!!disconnectConfirm); | 165 assertTrue(!!disconnectConfirm); |
| 166 assertFalse(disconnectConfirm.hidden); | 166 assertFalse(disconnectConfirm.hidden); |
| 167 MockInteractions.tap(disconnectConfirm); | 167 MockInteractions.tap(disconnectConfirm); |
| 168 | 168 |
| 169 // Wait for exit of dialog route. | 169 return browserProxy.whenCalled('signOut'); |
| 170 return new Promise(function(resolve) { | |
| 171 window.addEventListener('popstate', function callback() { | |
| 172 window.removeEventListener('popstate', callback); | |
| 173 resolve(browserProxy.whenCalled('signOut')); | |
| 174 }); | |
| 175 }); | |
| 176 }).then(function(deleteProfile) { | 170 }).then(function(deleteProfile) { |
| 171 Polymer.dom.flush(); |
| 172 |
| 177 assertFalse(deleteProfile); | 173 assertFalse(deleteProfile); |
| 178 | 174 |
| 179 cr.webUIListenerCallback('sync-status-changed', { | 175 cr.webUIListenerCallback('sync-status-changed', { |
| 180 signedIn: true, | 176 signedIn: true, |
| 181 domain: 'example.com', | 177 domain: 'example.com', |
| 182 }); | 178 }); |
| 183 Polymer.dom.flush(); | 179 Polymer.dom.flush(); |
| 184 | 180 |
| 185 assertFalse(peoplePage.$.disconnectDialog.open); | 181 assertFalse(peoplePage.$.disconnectDialog.open); |
| 186 MockInteractions.tap(disconnectButton); | 182 MockInteractions.tap(disconnectButton); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 245 } |
| 250 | 246 |
| 251 return { | 247 return { |
| 252 registerTests: function() { | 248 registerTests: function() { |
| 253 registerProfileInfoTests(); | 249 registerProfileInfoTests(); |
| 254 if (!cr.isChromeOS) | 250 if (!cr.isChromeOS) |
| 255 registerSyncStatusTests(); | 251 registerSyncStatusTests(); |
| 256 }, | 252 }, |
| 257 }; | 253 }; |
| 258 }); | 254 }); |
| OLD | NEW |