chromium/third_party/blink/web_tests/accessibility/aom-increment-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 type=range min=1 max=5 value=3 id="increment_target">

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

    var gotAccessibleEvent = false;
    target.accessibleNode.onaccessibleincrement = function() {
      gotAccessibleEvent = true;
    };

    // Finish the test after the synthesized keyup event, which is triggered
    // 100ms later, to prevent leaks.
    target.addEventListener("keyup",
        t.step_func_done((event) => {}), { once: true });

    axTarget.increment();

    assert_true(gotAccessibleEvent);
    assert_equals(target.value, "4");
  });
}, "AccessibleNode.onaccessibleincrement");
</script>