blob: b95faeb5cb09ef762d31a7d023443e6596e584a9 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body>
<input type="text" id="input" value="Line 1">
<script>
description("This tests that caret position is reported correctly for text input elements.");
if (window.accessibilityController) {
var input = document.getElementById('input');
input.focus();
var inputAccessible =
accessibilityController.accessibleElementById('input');
for (var characterIndex = 0; characterIndex < 7; ++characterIndex) {
input.setSelectionRange(characterIndex, characterIndex);
shouldBeEqualToNumber("inputAccessible.selectionStart",
characterIndex);
shouldBeEqualToNumber("inputAccessible.selectionEnd",
characterIndex);
}
}
</script>
</body>
</html>