OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>location_port</title> |
| 5 <script src="../../../../../../resources/testharness.js"></script> |
| 6 <script src="../../../../../../resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <div id="log"></div> |
| 10 <script> |
| 11 test(function () { |
| 12 var port = location.port; |
| 13 var url = location.href; |
| 14 |
| 15 var pos = url.indexOf("//"); |
| 16 if (pos != -1) { |
| 17 url = url.substr(pos+2, url.length-pos-2); |
| 18 pos = url.indexOf("/"); |
| 19 if (pos != -1) |
| 20 url = url.substr(0, pos); |
| 21 pos = url.indexOf(":"); |
| 22 if (pos != -1) |
| 23 url = url.substr(pos+1, url.length-pos-1); |
| 24 } |
| 25 |
| 26 assert_equals(port, url, "port"); |
| 27 |
| 28 }, "location port"); |
| 29 </script> |
| 30 </body> |
| 31 </html> |
OLD | NEW |