OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 | 7 |
8 <p id="p" style="width: 10em;"> | 8 <p id="p" style="width: 10em;"> |
9 This paragraph contains two lines of text. | 9 This paragraph contains two lines of text. |
10 </p> | 10 </p> |
11 | 11 |
12 <p id="description"></p> | 12 <p id="description"></p> |
13 <pre id="tree"></pre> | 13 <pre id="tree"></pre> |
14 <div id="console"></div> | 14 <div id="console"></div> |
15 | 15 |
16 <script> | 16 <script> |
17 | 17 |
18 description("Tests that accessible inline text boxes update when the static
text style changes."); | 18 description("Tests that accessible inline text boxes update when the static
text style changes."); |
19 | 19 |
20 if (window.accessibilityController) { | 20 if (window.accessibilityController) { |
21 testRunner.waitUntilDone(); | 21 testRunner.waitUntilDone(); |
22 window.jsTestIsAsync = true; | 22 window.jsTestIsAsync = true; |
23 | 23 |
24 window.axParagraph = accessibilityController.accessibleElementById('p'); | 24 window.axParagraph = accessibilityController.accessibleElementById('p'); |
25 window.axStaticText = axParagraph.childAtIndex(0); | 25 window.axStaticText = axParagraph.childAtIndex(0); |
26 shouldBe("axStaticText.childrenCount", "2"); | 26 shouldBe("axStaticText.childrenCount", "2"); |
27 | 27 |
28 window.axInlineBefore0 = axStaticText.childAtIndex(0); | 28 window.axInlineBefore0 = axStaticText.childAtIndex(0); |
29 shouldBe("axInlineBefore0.stringValue", "'AXValue: This paragraph conta
ins '"); | 29 shouldBe("axInlineBefore0.name", "'This paragraph contains '"); |
30 window.axInlineBefore1 = axStaticText.childAtIndex(1); | 30 window.axInlineBefore1 = axStaticText.childAtIndex(1); |
31 shouldBe("axInlineBefore1.stringValue", "'AXValue: two lines of text.'")
; | 31 shouldBe("axInlineBefore1.name", "'two lines of text.'"); |
32 | 32 |
33 // Modify the text. | 33 // Modify the text. |
34 document.getElementById("p").style.width = "100em"; | 34 document.getElementById("p").style.width = "100em"; |
35 | 35 |
36 // Wait for a notification on the element before checking the new state. | 36 // Wait for a notification on the element before checking the new state. |
37 axStaticText.addNotificationListener(function(notification) { | 37 axStaticText.addNotificationListener(function(notification) { |
38 // Make sure the inline text boxes changed. | 38 // Make sure the inline text boxes changed. |
39 shouldBe("axStaticText.childrenCount", "1"); | 39 shouldBe("axStaticText.childrenCount", "1"); |
40 window.axInlineAfter0 = axStaticText.childAtIndex(0); | 40 window.axInlineAfter0 = axStaticText.childAtIndex(0); |
41 shouldBe("axInlineAfter0.stringValue", "'AXValue: This paragraph co
ntains two lines of text.'"); | 41 shouldBe("axInlineAfter0.name", "'This paragraph contains two lines
of text.'"); |
42 finishJSTest(); | 42 finishJSTest(); |
43 }); | 43 }); |
44 } | 44 } |
45 </script> | 45 </script> |
46 | 46 |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |