chromium/third_party/blink/web_tests/accessibility/aom-focus-action.html

<!DOCTYPE HTML>
<script src="../resources/gc.js"></script>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../http/tests/resources/permissions-helper.js"></script>
<script src="resources/aom-helper.js"></script>

<!--

Accessibility Object Model
Explainer: https://github.com/WICG/aom/blob/gh-pages/explainer.md
Spec: https://wicg.github.io/aom/spec/

-->
<script>
test(function(t) {
    assert_true(internals.runtimeFlags.accessibilityObjectModelEnabled);
}, "Make sure that Accessibility Object Model is enabled");
</script>

<input id="focus_target">

<script>
async_test(function(t) {
  enableAccessibilityEventsPermission().then(function() {
    var target = document.getElementById("focus_target");
    var axTarget = accessibilityController.accessibleElementById("focus_target");

    var gotAccessibleEvent = false;
    target.accessibleNode.onaccessiblefocus = function() {
      gotAccessibleEvent = true;
    };
    axTarget.takeFocus();

    assert_true(gotAccessibleEvent);
    assert_equals(document.activeElement, target);
    t.done();
  });
}, "AccessibleNode.onaccessiblefocus");
</script>