Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLDocument / url-getset.html
blob41b5f69bb3fc4b549086e51fe7744650f8d4d3a1
1 <html>
2 <head>
3 <title>URL test</title>
4 <script type="text/javascript">
5 function print(message) {
6 var paragraph = document.createElement("p");
7 paragraph.appendChild(document.createTextNode(message));
8 document.getElementById("console").appendChild(paragraph);
11 function test() {
12 //test get URL
13 var len = document.URL.length;
14 var file = document.URL.substring(len - 11);
16 if (file=="getset.html")
17 print("Get: passed");
18 else
19 print("Get: failed");
21 //test set URL
22 if (window.testRunner) {
23 window.testRunner.dumpAsText();
25 var origURL = document.URL;
27 document.URL = origURL + '#testAnchor';
29 var newURL = document.URL;
31 if (newURL!=origURL) {
32 print("Set: failed");
33 } else {
34 print("Set: passed");
38 </script>
39 </head>
40 <body onload="test()">
41 <p>Tests: getting and setting HTMLDocument::url<br>
42 (Setting should do nothing since URL is readonly)</p>
43 <p>Condition(s): </p>
44 <p>Success message: passed</p>
45 <p>Failure message: failed</p>
46 <hr>
48 <a name='testAnchor'></A>
50 <div id='console'/>
51 </body>
52 </html>