| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| </head> |
| <body id="body"> |
| |
| <input type="checkbox" id="check1" /> |
| <input type="checkbox" id="check2" checked /> |
| |
| <div tabindex="0" role="checkbox" id="check3">X</div> |
| <div tabindex="0" role="checkbox" id="check4" aria-checked="true">X</div> |
| |
| <input type="checkbox" id="check5" aria-checked="false" /> |
| <input type="checkbox" id="check6" aria-checked="false" checked /> |
| <input type="checkbox" id="check7" aria-checked="true" /> |
| <input type="checkbox" id="check8" aria-checked="true" checked /> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| |
| description("This tests that ARIA checkboxes correctly handle the aria-checked attribute."); |
| |
| if (window.accessibilityController) { |
| |
| var answers = [[ "check1", "false" ], |
| [ "check2", "true" ], |
| [ "check3", "false" ], |
| [ "check4", "true" ], |
| [ "check5", "false" ], |
| [ "check6", "true" ], |
| [ "check7", "false" ], |
| [ "check8", "true" ]]; |
| |
| for (var i = 0; i < answers.length; i++) { |
| var checkbox = document.getElementById(answers[i][0]); |
| checkbox.focus(); |
| checkbox = accessibilityController.focusedElement; |
| shouldBe("checkbox.isChecked", answers[i][1]); |
| } |
| } |
| |
| </script> |
| |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |