chromium/third_party/blink/web_tests/accessibility/selection-change-notification-textarea.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>

<textarea autofocus id="textarea">textarea</textarea>

<script>
'use strict';

async_test_after_layout_and_paint((t) => {
  const axRoot = accessibilityController.rootElement;
  axRoot.setNotificationListener(t.step_func((notification, intents) => {
    if (notification == 'DocumentSelectionChanged') {
      assert_array_equals(intents,
                          ['AXEventIntent(setSelection,none,character,forward)']);
      axRoot.unsetNotificationListener();
      t.done();
    }
  }));

  const element = document.getElementById('textarea');
  element.setSelectionRange(0, 1);
});

</script>