1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../resources/js-test.js"></script>
8 <p id=
"p" style=
"width: 10em;">
9 This paragraph contains two lines of text.
12 <p id=
"description"></p>
14 <div id=
"console"></div>
18 description("Tests that accessible inline text boxes update when a static text node changes.");
20 if (window
.accessibilityController
) {
21 testRunner
.waitUntilDone();
22 window
.jsTestIsAsync
= true;
24 window
.axParagraph
= accessibilityController
.accessibleElementById('p');
25 window
.axStaticText
= axParagraph
.childAtIndex(0);
26 shouldBe("axStaticText.childrenCount", "2");
28 window
.axInlineBefore0
= axStaticText
.childAtIndex(0);
29 shouldBe("axInlineBefore0.stringValue", "'AXValue: This paragraph contains '");
30 window
.axInlineBefore1
= axStaticText
.childAtIndex(1);
31 shouldBe("axInlineBefore1.stringValue", "'AXValue: two lines of text.'");
34 document
.getElementById("p").innerText
+= ' One more sentence.';
36 // Wait for a notification on the element before checking the new state.
37 axStaticText
.addNotificationListener(function(notification
) {
38 // Make sure the inline text boxes changed.
39 shouldBe("axStaticText.childrenCount", "3");
40 window
.axInlineAfter0
= axStaticText
.childAtIndex(0);
41 shouldBe("axInlineAfter0.stringValue", "'AXValue: This paragraph contains '");
42 window
.axInlineAfter1
= axStaticText
.childAtIndex(1);
43 shouldBe("axInlineAfter1.stringValue", "'AXValue: two lines of text. One '");
44 window
.axInlineAfter2
= axStaticText
.childAtIndex(2);
45 shouldBe("axInlineAfter2.stringValue", "'AXValue: more sentence.'");
47 // Make sure the old object pointing to the second text box is no longer valid.
48 shouldBe("axInlineBefore1.stringValue", "'AXValue: '");