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

Side by Side Diff: chrome/test/data/webui/cr_elements/cr_dialog_test.js

Issue 2700063002: MD Settings: focus header when dialog shows to signal to AT what's going on (Closed)
Patch Set: +assert precondition Created 3 years, 10 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 2016 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('cr-dialog', function() {
6 /** @type {HTMLDialogElement} */ var dialog;
7 /** @type {HTMLElement} */ var title;
8
9 setup(function() {
10 PolymerTest.clearBody();
dpapad 2017/02/23 18:28:35 Nit: You could also do what we do at https://cs.ch
Dan Beam 2017/02/24 05:43:09 Done.
11
12 title = document.createElement('div');
13 title.classList.add('title');
14 title.textContent = 'An Amazing Title!';
15
16 dialog = document.createElement('dialog', 'cr-dialog');
17 dialog.appendChild(title);
18 document.body.appendChild(dialog);
19 });
20
21 test('focuses title on show', function() {
22 assertNotEquals(document.activeElement, title);
23 dialog.showModal();
24 expectEquals(title.tabIndex, -1);
25 expectEquals(document.activeElement, title);
dpapad 2017/02/23 18:28:35 Can we add one more test for a dialog that has an
Dan Beam 2017/02/24 05:43:09 Done.
26 });
27 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698