| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 function parseAndDumpURL(url) | 8 function parseAndDumpURL(url) |
| 9 { | 9 { |
| 10 var parsedURL = new WebInspector.ParsedURL(url); | 10 var parsedURL = new WebInspector.ParsedURL(url); |
| 11 | 11 |
| 12 InspectorTest.addResult("Parsing url: " + url); | 12 InspectorTest.addResult("Parsing url: " + url); |
| 13 InspectorTest.addResult(" isValid: " + parsedURL.isValid); | 13 InspectorTest.addResult(" isValid: " + parsedURL.isValid); |
| 14 InspectorTest.addResult(" scheme: " + parsedURL.scheme); | 14 InspectorTest.addResult(" scheme: " + parsedURL.scheme); |
| 15 InspectorTest.addResult(" host: " + parsedURL.host); | 15 InspectorTest.addResult(" host: " + parsedURL.host); |
| 16 InspectorTest.addResult(" port: " + parsedURL.port); | 16 InspectorTest.addResult(" port: " + parsedURL.port); |
| 17 InspectorTest.addResult(" path: " + parsedURL.path); | 17 InspectorTest.addResult(" path: " + parsedURL.path); |
| 18 InspectorTest.addResult(" queryParams: " + parsedURL.queryParams); | 18 InspectorTest.addResult(" queryParams: " + parsedURL.queryParams); |
| 19 InspectorTest.addResult(" fragment: " + parsedURL.fragment); | 19 InspectorTest.addResult(" fragment: " + parsedURL.fragment); |
| 20 InspectorTest.addResult(" folderPathComponents: " + parsedURL.folderPat
hComponents); | 20 InspectorTest.addResult(" folderPathComponents: " + parsedURL.folderPat
hComponents); |
| 21 InspectorTest.addResult(" lastPathComponent: " + parsedURL.lastPathComp
onent); | 21 InspectorTest.addResult(" lastPathComponent: " + parsedURL.lastPathComp
onent); |
| 22 var splittedURL = WebInspector.ParsedURL.splitURL(url); | 22 var splittedURL = WebInspector.ParsedURL.splitURLIntoPathComponents(url)
; |
| 23 InspectorTest.addResult(" splittedURL: " + JSON.stringify(splittedURL))
; | 23 InspectorTest.addResult(" splittedURL: " + JSON.stringify(splittedURL))
; |
| 24 } | 24 } |
| 25 | 25 |
| 26 parseAndDumpURL("http://example.com/?queryParam1=value1&queryParam2=value2#f
ragmentWith/Many//Slashes"); | 26 parseAndDumpURL("http://example.com/?queryParam1=value1&queryParam2=value2#f
ragmentWith/Many//Slashes"); |
| 27 parseAndDumpURL("http://example.com/foo.html?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&queryPar
am2=value2#fragmentWith/Many//Slashes"); | 28 parseAndDumpURL("http://example.com/foo/bar.html?queryParam1=value1&queryPar
am2=value2#fragmentWith/Many//Slashes"); |
| 29 parseAndDumpURL("http://example.com/foo/bar/baz.html?queryParam1=value1&quer
yParam2=value2#fragmentWith/Many//Slashes"); | 29 parseAndDumpURL("http://example.com/foo/bar/baz.html?queryParam1=value1&quer
yParam2=value2#fragmentWith/Many//Slashes"); |
| 30 | 30 |
| 31 // Test how double (and more than double) slashes are parsed. | 31 // Test how double (and more than double) slashes are parsed. |
| 32 parseAndDumpURL("http://example.com//?queryParam1=value1"); | 32 parseAndDumpURL("http://example.com//?queryParam1=value1"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 | 43 |
| 44 InspectorTest.completeTest(); | 44 InspectorTest.completeTest(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 </script> | 47 </script> |
| 48 </head> | 48 </head> |
| 49 <body onload="runTest()"> | 49 <body onload="runTest()"> |
| 50 <p>Tests inspector ParsedURL class</p> | 50 <p>Tests inspector ParsedURL class</p> |
| 51 </body> | 51 </body> |
| 52 </html> | 52 </html> |
| OLD | NEW |