OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 suite('sync-page-test', function() { |
| 6 /** @type {SyncPageElement} */ var testElement; |
| 7 |
| 8 setup(function() { |
| 9 PolymerTest.clearBody(); |
| 10 |
| 11 testElement = document.createElement('settings-sync-page'); |
| 12 document.body.appendChild(testElement); |
| 13 }); |
| 14 |
| 15 test('autofocus correctly after container is shown', function() { |
| 16 cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: true}); |
| 17 Polymer.dom.flush(); |
| 18 |
| 19 var input = testElement.$$('#existingPassphraseInput'); |
| 20 |
| 21 var focused = false; |
| 22 input.addEventListener('focus', function() { |
| 23 focused = true; |
| 24 }); |
| 25 |
| 26 // Simulate event normally fired by main_page_behavior after subpage |
| 27 // animation ends. |
| 28 testElement.fire('show-container'); |
| 29 assertTrue(focused); |
| 30 }); |
| 31 }); |
OLD | NEW |