cfleizach@apple.com | f46f53b | 2009-04-21 16:19:51 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <script> |
rniwa@webkit.org | 3526ecc3 | 2012-06-12 20:37:15 +0000 | [diff] [blame] | 3 | if (window.testRunner) |
| 4 | testRunner.dumpAsText(); |
cfleizach@apple.com | f46f53b | 2009-04-21 16:19:51 +0000 | [diff] [blame] | 5 | </script> |
| 6 | <body id="body"> |
| 7 | |
| 8 | <!-- This test makes sure that a secure text field has the correct title ui element --> |
| 9 | |
| 10 | <label for="accountpassword"><span class="dslabel">Password</span></label><br> |
| 11 | <input size="30" maxlength="32" id="accountpassword" type="password" name="theAccountPW"> |
| 12 | |
| 13 | <div id="result"></div> |
| 14 | |
| 15 | |
| 16 | <script> |
| 17 | if (window.accessibilityController) { |
| 18 | var result = document.getElementById("result"); |
| 19 | |
| 20 | var pass = document.getElementById("accountpassword"); |
| 21 | pass.focus(); |
| 22 | var titleUIElement = accessibilityController.focusedElement.titleUIElement(); |
jdiggs@igalia.com | 66d826c | 2015-05-01 19:39:28 +0000 | [diff] [blame] | 23 | // On the Mac, element text is exposed in StaticText children; in ATK, in the element itself. |
| 24 | var titleText = titleUIElement.childrenCount ? titleUIElement.childAtIndex(0) : titleUIElement; |
dmazzoni@google.com | ef9d335 | 2012-10-19 08:01:06 +0000 | [diff] [blame] | 25 | if (titleText.stringValue == "AXValue: Password") { |
cfleizach@apple.com | f46f53b | 2009-04-21 16:19:51 +0000 | [diff] [blame] | 26 | result.innerText += "Test passed\n"; |
| 27 | } |
| 28 | else { |
| 29 | result.innerText += "Test failed\n"; |
| 30 | } |
| 31 | } |
| 32 | </script> |
| 33 | </body> |
| 34 | </html> |