| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../resources/js-test.js"></script> |
| <script src="../resources/accessibility-helper.js"></script> |
| <input type="text" value="hello" id="textfield"> |
| description("This tests that when an auto fill element is removed we won't crash accessing an old value."); |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| var platformName = accessibilityController.platformName; |
| var axTextField = accessibilityController.accessibleElementById("textfield"); |
| var domTextField = document.getElementById("textfield"); |
| window.internals.setShowAutoFillButton(domTextField, "Contacts"); |
| var expectedChildrenCount = platformName == "atspi" ? "1" : "2"; |
| setTimeout(async function() { |
| await expectAsyncExpression("axTextField.childrenCount", expectedChildrenCount); |
| // Verify the autofill button is represented in the accessibility tree. |
| await expectAsyncExpression("axTextField.childAtIndex(expectedChildrenCount - 1).description", "'AXDescription: contact info AutoFill'"); |
| window.internals.setShowAutoFillButton(domTextField, "None"); |
| await expectAsyncExpression("axTextField.childrenCount", platformName == "atspi" ? "0" : "1"); |