blob: ca4a7d2b1148f585550392e456012787ac8bf89e [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p id="p">One paragraph in the document</p>
<script>
'use strict';
async_test((t) => {
const axElement = accessibilityController.rootElement;
axElement.setNotificationListener(t.step_func(function(notification, intents) {
if (notification == 'SelectedTextChanged') {
assert_array_equals(intents,
['AXEventIntent(setSelection,none,character,forward)']);
axElement.unsetNotificationListener();
t.done();
}
}));
const p = document.getElementById('p');
const range = document.createRange();
range.setStart(p.firstChild, 0);
range.setEnd(p.firstChild, 1);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
});
</script>