Chromium Code Reviews| Index: chrome/test/data/webui/settings/settings_sync_page_test.js |
| diff --git a/chrome/test/data/webui/settings/settings_sync_page_test.js b/chrome/test/data/webui/settings/settings_sync_page_test.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..028cf92c4e4aaf60a1e6e95d30fb899727f2cd2f |
| --- /dev/null |
| +++ b/chrome/test/data/webui/settings/settings_sync_page_test.js |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +suite('sync-page-test', function() { |
| + /** @type {SyncPageElement} */ var testElement; |
| + |
| + setup(function() { |
| + PolymerTest.clearBody(); |
| + |
| + testElement = document.createElement('settings-sync-page'); |
| + document.body.appendChild(testElement); |
| + }); |
| + |
| + test('autofocus correctly after container is shown', function() { |
| + cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: true}); |
| + Polymer.dom.flush(); |
| + |
| + var input = testElement.$$('#existingPassphraseInput'); |
| + |
| + var focused = false; |
| + input.addEventListener('focus', function() { |
| + focused = true; |
| + }); |
| + |
| + testElement.fire('show-container'); |
|
dpapad
2017/06/14 01:02:00
Nit: Maybe add a short comment
// Simulate event
|
| + assertTrue(focused); |
| + }); |
| +}); |