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

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

Issue 2941433002: MD Settings: fix auto-focus on sync page. (Closed)
Patch Set: address feedback; add tests Created 3 years, 6 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
OLDNEW
(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 testElement.fire('show-container');
dpapad 2017/06/14 01:02:00 Nit: Maybe add a short comment // Simulate event
27 assertTrue(focused);
28 });
29 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698