Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / parsed-url.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script type="text/javascript">
5
6 function test()
7 {
8     function parseAndDumpURL(url)
9     {
10         var parsedURL = new WebInspector.ParsedURL(url);
11
12         InspectorTest.addResult("Parsing url: " + url);
13         InspectorTest.addResult("  isValid: " + parsedURL.isValid);
14         InspectorTest.addResult("  scheme: " + parsedURL.scheme);
15         InspectorTest.addResult("  host: " + parsedURL.host);
16         InspectorTest.addResult("  port: " + parsedURL.port);
17         InspectorTest.addResult("  path: " + parsedURL.path);
18         InspectorTest.addResult("  queryParams: " + parsedURL.queryParams);
19         InspectorTest.addResult("  fragment: " + parsedURL.fragment);
20         InspectorTest.addResult("  folderPathComponents: " + parsedURL.folderPathComponents);
21         InspectorTest.addResult("  lastPathComponent: " + parsedURL.lastPathComponent);
22         var splittedURL = WebInspector.ParsedURL.splitURL(url);
23         InspectorTest.addResult("  splittedURL: " + JSON.stringify(splittedURL));
24     }
25
26     parseAndDumpURL("http://example.com/?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes");
27     parseAndDumpURL("http://example.com/foo.html?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes");
28     parseAndDumpURL("http://example.com/foo/bar.html?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes");
29     parseAndDumpURL("http://example.com/foo/bar/baz.html?queryParam1=value1&queryParam2=value2#fragmentWith/Many//Slashes");
30
31     // Test how double (and more than double) slashes are parsed.
32     parseAndDumpURL("http://example.com//?queryParam1=value1");
33     parseAndDumpURL("http://example.com//foo.html");
34     parseAndDumpURL("http://example.com//foo/bar.html");
35     parseAndDumpURL("http://example.com/foo//bar.html");
36     parseAndDumpURL("http://example.com//foo//bar.html");
37     parseAndDumpURL("http://example.com//foo/bar/baz.html");
38     parseAndDumpURL("http://example.com/foo//bar/baz.html");
39     parseAndDumpURL("http://example.com/foo/bar//baz.html");
40     parseAndDumpURL("http://example.com///foo/bar/baz.html");
41     parseAndDumpURL("http://example.com/foo////bar/baz.html");
42     parseAndDumpURL("http://example.com/foo/bar/////baz.html");
43
44     InspectorTest.completeTest();
45 }
46
47 </script>
48 </head>
49 <body onload="runTest()">
50 <p>Tests inspector ParsedURL class</p>
51 </body>
52 </html>