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_sync_page', function() { | 5 cr.define('settings_people_page_sync_page', function() { |
6 /** | 6 /** |
7 * @constructor | 7 * @constructor |
8 * @implements {settings.SyncBrowserProxy} | 8 * @implements {settings.SyncBrowserProxy} |
9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
10 */ | 10 */ |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 assertTrue(!!syncPage.$$('#create-password-box')); | 280 assertTrue(!!syncPage.$$('#create-password-box')); |
281 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); | 281 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); |
282 assertTrue(!!saveNewPassphrase); | 282 assertTrue(!!saveNewPassphrase); |
283 | 283 |
284 // Test that a sync prefs update does not reset the selection. | 284 // Test that a sync prefs update does not reset the selection. |
285 cr.webUIListenerCallback('sync-prefs-changed', getSyncAllPrefs()); | 285 cr.webUIListenerCallback('sync-prefs-changed', getSyncAllPrefs()); |
286 Polymer.dom.flush(); | 286 Polymer.dom.flush(); |
287 assertTrue(encryptWithPassphrase.checked); | 287 assertTrue(encryptWithPassphrase.checked); |
288 }); | 288 }); |
289 | 289 |
290 test('ClickingLinkDoesNotChangeRadioValue', function() { | |
291 assertFalse(encryptWithPassphrase.disabled); | |
292 assertFalse(encryptWithPassphrase.checked); | |
293 | |
294 // Make sure the checkbox is enabled and checked. | |
tommycli
2016/12/15 16:08:33
nit: it's actually a radio box
Dan Beam
2016/12/16 01:24:40
Done.
| |
295 var link = encryptWithPassphrase.querySelector('a[href]'); | |
296 assertTrue(!!link); | |
297 | |
298 // Suppress opening a new tab, since then the test will continue running | |
299 // on a background tab (which has throttled timers) and will timeout. | |
300 link.target = ''; | |
301 link.href = '#'; | |
302 | |
303 MockInteractions.tap(link); | |
304 | |
305 assertFalse(encryptWithPassphrase.checked); | |
306 }); | |
307 | |
290 test('SaveButtonDisabledWhenPassphraseOrConfirmationEmpty', function() { | 308 test('SaveButtonDisabledWhenPassphraseOrConfirmationEmpty', function() { |
291 MockInteractions.tap(encryptWithPassphrase); | 309 MockInteractions.tap(encryptWithPassphrase); |
292 Polymer.dom.flush(); | 310 Polymer.dom.flush(); |
293 | 311 |
294 assertTrue(!!syncPage.$$('#create-password-box')); | 312 assertTrue(!!syncPage.$$('#create-password-box')); |
295 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); | 313 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); |
296 var passphraseInput = syncPage.$$('#passphraseInput'); | 314 var passphraseInput = syncPage.$$('#passphraseInput'); |
297 var passphraseConfirmationInput = | 315 var passphraseConfirmationInput = |
298 syncPage.$$('#passphraseConfirmationInput'); | 316 syncPage.$$('#passphraseConfirmationInput'); |
299 | 317 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 }); | 487 }); |
470 }); | 488 }); |
471 } | 489 } |
472 | 490 |
473 return { | 491 return { |
474 registerTests: function() { | 492 registerTests: function() { |
475 registerAdvancedSyncSettingsTests(); | 493 registerAdvancedSyncSettingsTests(); |
476 }, | 494 }, |
477 }; | 495 }; |
478 }); | 496 }); |
OLD | NEW |