blob: 41b5f69bb3fc4b549086e51fe7744650f8d4d3a1 [file] [log] [blame]
<html>
<head>
<title>URL test</title>
<script type="text/javascript">
function print(message) {
var paragraph = document.createElement("p");
paragraph.appendChild(document.createTextNode(message));
document.getElementById("console").appendChild(paragraph);
}
function test() {
//test get URL
var len = document.URL.length;
var file = document.URL.substring(len - 11);
if (file=="getset.html")
print("Get: passed");
else
print("Get: failed");
//test set URL
if (window.testRunner) {
window.testRunner.dumpAsText();
}
var origURL = document.URL;
document.URL = origURL + '#testAnchor';
var newURL = document.URL;
if (newURL!=origURL) {
print("Set: failed");
} else {
print("Set: passed");
}
}
</script>
</head>
<body onload="test()">
<p>Tests: getting and setting HTMLDocument::url<br>
(Setting should do nothing since URL is readonly)</p>
<p>Condition(s): </p>
<p>Success message: passed</p>
<p>Failure message: failed</p>
<hr>
<a name='testAnchor'></A>
<div id='console'/>
</body>
</html>