chromium/third_party/blink/web_tests/accessibility/aria-checkbox-checked-mixed.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body id="body">

<div id="element1" role="checkbox" aria-checked="mixed"></div>
<div id="element2" role="menuitemcheckbox" aria-checked="mixed"></div>
<!-- Radio, menuitemradio, and switch do not support mixed. It's treated as false. -->
<div id="element3" role="radio" aria-checked="mixed"></div>
<div id="element4" role="menuitemradio" aria-checked="mixed"></div>
<div id="element5" role="switch" aria-checked="mixed"></div>

<input id="element6" type="checkbox" aria-checked="mixed" checked />
<input id="element7" type="checkbox" aria-checked="mixed" />
<input id="element8" type="radio" aria-checked="mixed" checked />
<input id="element9" type="radio" aria-checked="mixed" />
<input id="element10" type="button" aria-checked="mixed" />

<p id="description"></p>
<div id="console"></div>

<script>

test((t) => {
    let roles = ["AXRole: AXCheckBox",
                 "AXRole: AXMenuItemCheckBox",
                 "AXRole: AXRadioButton",
                 "AXRole: AXMenuItemRadio",
                 "AXRole: AXSwitch",
                 "AXRole: AXCheckBox",
                 "AXRole: AXCheckBox",
                 "AXRole: AXRadioButton",
                 "AXRole: AXRadioButton",
                 "AXRole: AXButton"];
    let checked = ["mixed",
                   "mixed",
                   "false",
                   "false",
                   "false",
                   "true",
                   "false",
                   "true",
                   "false",
                   ""];

    for (var i = 1; i <= 10; i++) {
        var ax_object = accessibilityController.accessibleElementById("element" + i);
        assert_equals(ax_object.role, roles[i - 1]);
        assert_equals(ax_object.checked, checked[i - 1]);
    }
}, "Check whether ARIA mixed state is reported properly");

</script>

</body>
</html>