| 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 var link = encryptWithPassphrase.querySelector('a[href]'); |
| 295 assertTrue(!!link); |
| 296 |
| 297 // Suppress opening a new tab, since then the test will continue running |
| 298 // on a background tab (which has throttled timers) and will timeout. |
| 299 link.target = ''; |
| 300 link.href = '#'; |
| 301 |
| 302 MockInteractions.tap(link); |
| 303 |
| 304 assertFalse(encryptWithPassphrase.checked); |
| 305 }); |
| 306 |
| 290 test('SaveButtonDisabledWhenPassphraseOrConfirmationEmpty', function() { | 307 test('SaveButtonDisabledWhenPassphraseOrConfirmationEmpty', function() { |
| 291 MockInteractions.tap(encryptWithPassphrase); | 308 MockInteractions.tap(encryptWithPassphrase); |
| 292 Polymer.dom.flush(); | 309 Polymer.dom.flush(); |
| 293 | 310 |
| 294 assertTrue(!!syncPage.$$('#create-password-box')); | 311 assertTrue(!!syncPage.$$('#create-password-box')); |
| 295 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); | 312 var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); |
| 296 var passphraseInput = syncPage.$$('#passphraseInput'); | 313 var passphraseInput = syncPage.$$('#passphraseInput'); |
| 297 var passphraseConfirmationInput = | 314 var passphraseConfirmationInput = |
| 298 syncPage.$$('#passphraseConfirmationInput'); | 315 syncPage.$$('#passphraseConfirmationInput'); |
| 299 | 316 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 }); | 486 }); |
| 470 }); | 487 }); |
| 471 } | 488 } |
| 472 | 489 |
| 473 return { | 490 return { |
| 474 registerTests: function() { | 491 registerTests: function() { |
| 475 registerAdvancedSyncSettingsTests(); | 492 registerAdvancedSyncSettingsTests(); |
| 476 }, | 493 }, |
| 477 }; | 494 }; |
| 478 }); | 495 }); |
| OLD | NEW |