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

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

Issue 2694863002: MD Settings: Smart lock dialog is missing. (Closed)
Patch Set: Added tests. Created 3 years, 10 months 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/easy_unlock_turn_off_dialog.html ('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 /** @fileoverview Suite of tests for Easy Unlock within People section. */ 5 /** @fileoverview Suite of tests for Easy Unlock within People section. */
6 6
7 GEN_INCLUDE(['settings_page_browsertest.js']); 7 GEN_INCLUDE(['settings_page_browsertest.js']);
8 8
9 /** 9 /**
10 * @constructor 10 * @constructor
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 expectFalse(turnOffButton.hidden) 186 expectFalse(turnOffButton.hidden)
187 187
188 MockInteractions.tap(turnOffButton); 188 MockInteractions.tap(turnOffButton);
189 return browserProxy.whenCalled('getTurnOffFlowStatus'); 189 return browserProxy.whenCalled('getTurnOffFlowStatus');
190 }).then(function() { 190 }).then(function() {
191 Polymer.dom.flush(); 191 Polymer.dom.flush();
192 192
193 turnOffDialog = page.$$('#easyUnlockTurnOffDialog'); 193 turnOffDialog = page.$$('#easyUnlockTurnOffDialog');
194 assertTrue(!!turnOffDialog); 194 assertTrue(!!turnOffDialog);
195 195
196 // Verify that elements on the turn off dialog are hidden or active
197 // according to the easy unlock turn off status.
198 var turnOffDialogButtonContainer =
199 turnOffDialog.$$('.button-container');
200 var turnOffDialogButtonSpinner = turnOffDialog.$$('paper-spinner');
196 var turnOffDialogConfirmButton = turnOffDialog.$$('#turnOff'); 201 var turnOffDialogConfirmButton = turnOffDialog.$$('#turnOff');
202 var turnOffDialogCancelButton = turnOffDialog.$$('.cancel-button');
203 assertTrue(!!turnOffDialogButtonContainer);
204 assertTrue(!!turnOffDialogButtonSpinner);
197 assertTrue(!!turnOffDialogConfirmButton); 205 assertTrue(!!turnOffDialogConfirmButton);
206 assertTrue(!!turnOffDialogCancelButton);
207
208 cr.webUIListenerCallback('easy-unlock-turn-off-flow-status', 'offline');
209 expectTrue(turnOffDialogButtonContainer.hidden);
210 expectFalse(turnOffDialogButtonSpinner.active);
211
212 cr.webUIListenerCallback('easy-unlock-turn-off-flow-status', 'pending');
213 expectFalse(turnOffDialogButtonContainer.hidden);
214 expectTrue(turnOffDialogButtonSpinner.active);
215
216 cr.webUIListenerCallback('easy-unlock-turn-off-flow-status',
217 'server-error');
218 expectFalse(turnOffDialogButtonContainer.hidden);
219 expectTrue(turnOffDialogCancelButton.hidden);
220
221 cr.webUIListenerCallback('easy-unlock-turn-off-flow-status', 'idle');
198 expectFalse(turnOffDialogConfirmButton.hidden); 222 expectFalse(turnOffDialogConfirmButton.hidden);
199 223
200 MockInteractions.tap(turnOffDialogConfirmButton); 224 MockInteractions.tap(turnOffDialogConfirmButton);
201 225
202 return browserProxy.whenCalled('startTurnOffFlow'); 226 return browserProxy.whenCalled('startTurnOffFlow');
203 }).then(function() { 227 }).then(function() {
204 // To signal successful turnoff, the enabled status is broadcast 228 // To signal successful turnoff, the enabled status is broadcast
205 // as false. At that point, the dialog should close and cancel 229 // as false. At that point, the dialog should close and cancel
206 // any in-progress turnoff flow. The cancellation should be 230 // any in-progress turnoff flow. The cancellation should be
207 // a no-op assuming the turnoff originated from this tab. 231 // a no-op assuming the turnoff originated from this tab.
208 cr.webUIListenerCallback('easy-unlock-enabled-status', false); 232 cr.webUIListenerCallback('easy-unlock-enabled-status', false);
209 return browserProxy.whenCalled('cancelTurnOffFlow'); 233 return browserProxy.whenCalled('cancelTurnOffFlow');
210 }).then(function() { 234 }).then(function() {
211 Polymer.dom.flush(); 235 Polymer.dom.flush();
212 expectFalse(turnOffDialog.$.dialog.open); 236 expectFalse(turnOffDialog.$.dialog.open);
213 }); 237 });
214 }); 238 });
215 }); 239 });
216 240
217 // Run all registered tests. 241 // Run all registered tests.
218 mocha.run(); 242 mocha.run();
219 }); 243 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/people_page/easy_unlock_turn_off_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698