blob: 96a7e50f08d44de72beba7ae53a1caca38a55835 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta charset="utf-8">
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
<input type="text" value="hello" id="textfield">
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that when an auto fill element is removed we won't crash accessing an old value.");
if (window.accessibilityController) {
var axTextField = accessibilityController.accessibleElementById("textfield");
var childrenCountExpected = accessibilityController.platformName == "atk" ? "1" : "2";
window.internals.setShowAutoFillButton(document.getElementById("textfield"), "Contacts");
var textFieldAxObject = accessibilityController.accessibleElementById('textfield');
shouldBe("textFieldAxObject.childrenCount", childrenCountExpected);
// Verify the autofill button is represented in the accessibility tree.
shouldBe("textFieldAxObject.childAtIndex(childrenCountExpected - 1).description", "'AXDescription: contact info AutoFill'");
var platform = accessibilityController.platformName;
// Windows expects 2 children.
childrenCountExpected = "2";
if (platform == "mac" || platform == "ios")
childrenCountExpected = "1"
else if (platform == "atk")
childrenCountExpected = "0"
// Don't crash!
window.internals.setShowAutoFillButton(document.getElementById("textfield"), "None");
shouldBe("textFieldAxObject.childrenCount", childrenCountExpected);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>