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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 test('GetProfileInfo', function() { | 151 test('GetProfileInfo', function() { |
152 var disconnectButton = null; | 152 var disconnectButton = null; |
153 return browserProxy.whenCalled('getSyncStatus').then(function() { | 153 return browserProxy.whenCalled('getSyncStatus').then(function() { |
154 Polymer.dom.flush(); | 154 Polymer.dom.flush(); |
155 disconnectButton = peoplePage.$$('#disconnectButton'); | 155 disconnectButton = peoplePage.$$('#disconnectButton'); |
156 assertTrue(!!disconnectButton); | 156 assertTrue(!!disconnectButton); |
157 | 157 |
158 MockInteractions.tap(disconnectButton); | 158 MockInteractions.tap(disconnectButton); |
159 Polymer.dom.flush(); | 159 Polymer.dom.flush(); |
| 160 }).then(function() { |
| 161 assertTrue(!!peoplePage.$$('#disconnectDialog').open); |
| 162 assertFalse(peoplePage.$$('#deleteProfile').hidden); |
160 | 163 |
161 assertTrue(peoplePage.$.disconnectDialog.open); | 164 var disconnectConfirm = peoplePage.$$('#disconnectConfirm'); |
162 assertFalse(peoplePage.$.deleteProfile.hidden); | |
163 | |
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 return browserProxy.whenCalled('signOut'); | 169 return browserProxy.whenCalled('signOut'); |
170 }).then(function(deleteProfile) { | 170 }).then(function(deleteProfile) { |
171 Polymer.dom.flush(); | 171 Polymer.dom.flush(); |
172 | 172 |
173 assertFalse(deleteProfile); | 173 assertFalse(deleteProfile); |
174 | 174 |
175 cr.webUIListenerCallback('sync-status-changed', { | 175 cr.webUIListenerCallback('sync-status-changed', { |
176 signedIn: true, | 176 signedIn: true, |
177 domain: 'example.com', | 177 domain: 'example.com', |
178 }); | 178 }); |
179 Polymer.dom.flush(); | 179 Polymer.dom.flush(); |
180 | 180 |
181 assertFalse(peoplePage.$.disconnectDialog.open); | 181 assertFalse(!!peoplePage.$$('#disconnectDialog')); |
182 MockInteractions.tap(disconnectButton); | 182 MockInteractions.tap(disconnectButton); |
183 Polymer.dom.flush(); | 183 Polymer.dom.flush(); |
184 | 184 }).then(function() { |
185 assertTrue(peoplePage.$.disconnectDialog.open); | 185 assertTrue(peoplePage.$$('#disconnectDialog').open); |
186 assertTrue(peoplePage.$.deleteProfile.hidden); | 186 assertTrue(peoplePage.$$('#deleteProfile').hidden); |
187 | 187 |
188 var disconnectManagedProfileConfirm = | 188 var disconnectManagedProfileConfirm = |
189 peoplePage.$.disconnectManagedProfileConfirm; | 189 peoplePage.$$('#disconnectManagedProfileConfirm'); |
190 assertTrue(!!disconnectManagedProfileConfirm); | 190 assertTrue(!!disconnectManagedProfileConfirm); |
191 assertFalse(disconnectManagedProfileConfirm.hidden); | 191 assertFalse(disconnectManagedProfileConfirm.hidden); |
192 | 192 |
193 browserProxy.resetResolver('signOut'); | 193 browserProxy.resetResolver('signOut'); |
194 MockInteractions.tap(disconnectManagedProfileConfirm); | 194 MockInteractions.tap(disconnectManagedProfileConfirm); |
195 | 195 |
196 return browserProxy.whenCalled('signOut'); | 196 return browserProxy.whenCalled('signOut'); |
197 }).then(function(deleteProfile) { | 197 }).then(function(deleteProfile) { |
198 assertTrue(deleteProfile); | 198 assertTrue(deleteProfile); |
199 }); | 199 }); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 245 } |
246 | 246 |
247 return { | 247 return { |
248 registerTests: function() { | 248 registerTests: function() { |
249 registerProfileInfoTests(); | 249 registerProfileInfoTests(); |
250 if (!cr.isChromeOS) | 250 if (!cr.isChromeOS) |
251 registerSyncStatusTests(); | 251 registerSyncStatusTests(); |
252 }, | 252 }, |
253 }; | 253 }; |
254 }); | 254 }); |
OLD | NEW |