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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/cr_elements/cr_dialog_test.js
diff --git a/chrome/test/data/webui/cr_elements/cr_dialog_test.js b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..801c0e8c3c1f451e864bdfaa5647e371b5566484
--- /dev/null
+++ b/chrome/test/data/webui/cr_elements/cr_dialog_test.js
@@ -0,0 +1,27 @@
+// Copyright 2016 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('cr-dialog', function() {
+ /** @type {HTMLDialogElement} */ var dialog;
+ /** @type {HTMLElement} */ var title;
+
+ setup(function() {
+ 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.
+
+ title = document.createElement('div');
+ title.classList.add('title');
+ title.textContent = 'An Amazing Title!';
+
+ dialog = document.createElement('dialog', 'cr-dialog');
+ dialog.appendChild(title);
+ document.body.appendChild(dialog);
+ });
+
+ test('focuses title on show', function() {
+ assertNotEquals(document.activeElement, title);
+ dialog.showModal();
+ expectEquals(title.tabIndex, -1);
+ 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.
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698