chromium/third_party/blink/web_tests/fast/dom/HTMLDocument/url-getset.html

<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) {
		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>