chromium/third_party/blink/web_tests/accessibility/selection-change-notification-input.html

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/run-after-layout-and-paint.js"></script>

<input autofocus id="input" value="input">

<script>
'use strict';

async_test_after_layout_and_paint((t) => {
  const inputElement = document.getElementById('input');
  const axRootElement = accessibilityController.rootElement;

  const succeedIfDone = t.step_func(() => {
      t.done();
  });

  axRootElement.setNotificationListener(function(notification, intents) {
    if (notification == 'DocumentSelectionChanged') {
      assert_array_equals(intents,
                          ['AXEventIntent(setSelection,none,character,forward)']);
      axRootElement.unsetNotificationListener();
      succeedIfDone();
    }
  });

  inputElement.setSelectionRange(0, 1);
});

</script>