blob: 6a5cbf8c4139268eef6ac344caefa903d7776c5f [file] [log] [blame] [edit]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/accessibility-helper.js"></script>
<script src="../resources/js-test.js"></script>
</head>
<body>
<input id="input" type="image" src="url-test1.html"><BR>
<a id="anchor" href="#url-test2.html">test</a><BR>
<img id="img" src="url-test3.png" width=100 height=100 alt="test"><BR>
<script>
var testOutput = "This test ensures that we can retrieve URLs for appropriate elements.\n\n";
if (window.accessibilityController) {
window.jsTestIsAsync = true;
testOutput += expect("accessibilityController.accessibleElementById('input').url.indexOf('url-test1.html') !== -1", "true");
testOutput += expect("accessibilityController.accessibleElementById('anchor').url.indexOf('url-test2.html') !== -1", "true");
testOutput += expect("accessibilityController.accessibleElementById('img').url.indexOf('url-test3.png') !== -1", "true");
testOutput += "\nChanging href of #anchor to 'foobar.html'\n";
document.getElementById("anchor").setAttribute("href", "foobar.html");
setTimeout(async function() {
await waitFor(() => accessibilityController.accessibleElementById("anchor").url.indexOf("foobar.html") !== -1);
testOutput += expect("accessibilityController.accessibleElementById('anchor').url.indexOf('foobar.html') !== -1", "true");
debug(testOutput);
finishJSTest();
}, 0);
}
</script>
</body>
</html>