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

Unified Diff: third_party/WebKit/LayoutTests/accessibility/aria-modal.html

Issue 2666873005: Implement aria-modal (Closed)
Patch Set: Created 3 years, 11 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: third_party/WebKit/LayoutTests/accessibility/aria-modal.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-modal.html b/third_party/WebKit/LayoutTests/accessibility/aria-modal.html
new file mode 100644
index 0000000000000000000000000000000000000000..7efdbb39af189d3d1300658f3447f59e6a36a329
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/accessibility/aria-modal.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<dialog id="modal-1">
+ <div id="aria-modal-1" role="button" aria-modal="true">
+ </div>
+ <div id="aria-modal-2" role="dialog" aria-modal="false">
+ </div>
+ <div id="aria-modal-3" role="dialog" aria-modal="true">
+ </div>
+ <div id="aria-modal-4" role="alertdialog" aria-modal="true">
+ </div>
+ <dialog id="modal-2">Closed Dialog</dialog>
+ <dialog open id="modal-3">Open Dialog</dialog>
+ <dialog open id="modal-4" aria-modal="true">Open with aria-modal</dialog>
+</dialog>
+
+<script>
+document.getElementById('modal-1').showModal();
+
+function axElementById(id) {
+ return accessibilityController.accessibleElementById(id);
+}
+
+test(function(t) {
+ var axAriaModal1 = axElementById("aria-modal-1");
+ assert_equals(axAriaModal1.isModal, false);
+}, "A button can't be modal");
+
+test(function(t) {
+ var axAriaModal2 = axElementById("aria-modal-2");
+ assert_equals(axAriaModal2.isModal, false);
+}, "An ARIA dialog with aria-modal false is not modal");
+
+test(function(t) {
+ var axAriaModal3 = axElementById("aria-modal-3");
+ assert_equals(axAriaModal3.isModal, true);
+}, "An ARIA dialog with aria-modal true is modal");
+
+test(function(t) {
+ var axAriaModal4 = axElementById("aria-modal-4");
+ assert_equals(axAriaModal4.isModal, true);
+}, "An ARIA alertdialog with aria-modal true is modal");
+
+test(function(t) {
+ var axModal1 = axElementById("modal-1");
+ assert_equals(axModal1.isModal, true);
+}, "An HTML dialog is modal after calling showModal() on it");
+
+test(function(t) {
+ var axModal2 = axElementById("modal-2");
+ assert_equals(axModal2, undefined);
+}, "A closed HTML dialog has no accessibility node");
+
+test(function(t) {
+ var axModal3 = axElementById("modal-3");
+ assert_equals(axModal3.isModal, false);
+}, "An open HTML dialog is not modal");
+
+test(function(t) {
+ var axModal4 = axElementById("modal-4");
+ assert_equals(axModal4.isModal, true);
+}, "An open HTML dialog with aria-modal=true is modal");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698