4 <script src=
"../resources/js-test.js"></script>
6 <body id=
"static_eventTarget">
8 <textarea id=
"textarea">textarea
</textarea>
10 <div id=
"console"></div>
12 description("Tests that a 'selected text changed' notification fires on an textarea element when the user moves the cursor.");
13 window
.jsTestIsAsync
= true;
16 // This forces building the accessibility tree, because selection change
17 // events only fire on elements that already exist.
18 accessibilityController
.accessibleElementById('dummy');
20 var element
= document
.getElementById('textarea');
21 var axElement
= accessibilityController
.accessibleElementById('textarea');
24 axElement
.addNotificationListener(function(notification
) {
25 if (notification
== 'SelectedTextChanged') {
26 debug('Got SelectedTextChanged notification on textarea element.');
27 axElement
.removeNotificationListener();
32 element
.setSelectionRange(0, 1);
35 if (window
.testRunner
&& window
.accessibilityController
) {
36 testRunner
.dumpAsText();
37 window
.onload
= runTest();