Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / HTMLDocument / url-getset.html
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);
9 }
10
11 function test() {
12         //test get URL
13         var len = document.URL.length;
14         var file = document.URL.substring(len - 11);
15         
16         if (file=="getset.html")
17                 print("Get: passed");
18         else
19                 print("Get: failed");
20                 
21         //test set URL
22         if (window.testRunner) {
23                 window.testRunner.dumpAsText();
24         }
25         var origURL = document.URL;
26         
27         document.URL = origURL + '#testAnchor';
28         
29         var newURL = document.URL;
30         
31         if (newURL!=origURL) {
32                 print("Set: failed");
33         } else {
34                 print("Set: passed");
35         }
36         
37 }
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>
47
48 <a name='testAnchor'></A>
49
50 <div id='console'/>
51 </body>
52 </html>