blob: 9819a438cb9c07315e8c50f562f93784b237b2e2 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<pre id="content">
first line
second line
</pre>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests the ability to get element text for different granularities and offsets.");
if (window.accessibilityController) {
document.getElementById("body").focus();
var webArea = accessibilityController.focusedElement;
var content = webArea.childAtIndex(0);
shouldBe("content.lineAtOffset(0)", "'\\t\\n, 0, 2'");
shouldBe("content.lineAtOffset(2)", "'\\tfirst line\\n, 2, 14'");
shouldBe("content.lineAtOffset(14)", "'\\tsecond line\\n, 14, 27'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>