| 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> | 4 <script> |
| 5 function test() | 5 function test() |
| 6 { | 6 { |
| 7 var paths = { | 7 var paths = { |
| 8 FOO: "file:///home/username/projects/foo", | 8 FOO: "file:///home/username/projects/foo", |
| 9 BAR: "file:///home/username/projects/bar", | 9 BAR: "file:///home/username/projects/bar", |
| 10 SITE1: "file:///www/site1" | 10 SITE1: "file:///www/site1" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 function addMappingForResource(fileSystemMapping, url, fileSystemPath, fileP
ath) | 48 function addMappingForResource(fileSystemMapping, url, fileSystemPath, fileP
ath) |
| 49 { | 49 { |
| 50 InspectorTest.addResult("Adding file mapping for resource (" + url + ",
" + fileSystemPath + ", " + filePath + ")"); | 50 InspectorTest.addResult("Adding file mapping for resource (" + url + ",
" + fileSystemPath + ", " + filePath + ")"); |
| 51 fileSystemMapping.addMappingForResource(url, fileSystemPath, filePath); | 51 fileSystemMapping.addMappingForResource(url, fileSystemPath, filePath); |
| 52 checkAndDumpFileSystemMapping(fileSystemMapping); | 52 checkAndDumpFileSystemMapping(fileSystemMapping); |
| 53 } | 53 } |
| 54 | 54 |
| 55 function dumpFileForURL(fileSystemMapping, url) | 55 function dumpFileForURL(fileSystemMapping, url) |
| 56 { | 56 { |
| 57 var hasMappingForURL = fileSystemMapping.hasMappingForURL(url); | 57 var hasMappingForNetworkURL = fileSystemMapping.hasMappingForNetworkURL(
url); |
| 58 InspectorTest.addResult(" Has mapping for '" + url + "': " + hasMappi
ngForURL); | 58 InspectorTest.addResult(" Has mapping for '" + url + "': " + hasMappi
ngForNetworkURL); |
| 59 var fileForURL = fileSystemMapping.fileForURL(url); | 59 var fileForURL = fileSystemMapping.fileForURL(url); |
| 60 if (!fileForURL) | 60 if (!fileForURL) |
| 61 InspectorTest.addResult(" File for '" + url + "': null"); | 61 InspectorTest.addResult(" File for '" + url + "': null"); |
| 62 else | 62 else |
| 63 InspectorTest.addResult(" File for '" + url + "': " + fileForURL.
fileURL); | 63 InspectorTest.addResult(" File for '" + url + "': " + fileForURL.
fileURL); |
| 64 } | 64 } |
| 65 | 65 |
| 66 function dumpURLForPath(fileSystemMapping, fileSystemPath, filePath) | 66 function dumpURLForPath(fileSystemMapping, fileSystemPath, filePath) |
| 67 { | 67 { |
| 68 var url = fileSystemMapping.urlForPath(fileSystemPath, filePath); | 68 var url = fileSystemMapping.networkURLForFileSystemURL(fileSystemPath, f
ilePath); |
| 69 InspectorTest.addResult(" URL for path '" + filePath + "': " + url); | 69 InspectorTest.addResult(" URL for path '" + filePath + "': " + url); |
| 70 } | 70 } |
| 71 | 71 |
| 72 function checkAndDumpFileSystemMapping(fileSystemMapping) | 72 function checkAndDumpFileSystemMapping(fileSystemMapping) |
| 73 { | 73 { |
| 74 var fileSystemPaths = Object.keys(fileSystemMapping._fileSystemMappings)
; | 74 var fileSystemPaths = Object.keys(fileSystemMapping._fileSystemMappings)
; |
| 75 InspectorTest.addResult("Testing file system mapping."); | 75 InspectorTest.addResult("Testing file system mapping."); |
| 76 InspectorTest.addResult(" file system paths:"); | 76 InspectorTest.addResult(" file system paths:"); |
| 77 for (var i = 0; i < fileSystemPaths.length; ++i) { | 77 for (var i = 0; i < fileSystemPaths.length; ++i) { |
| 78 InspectorTest.addResult(" - " + fileSystemPaths[i]); | 78 InspectorTest.addResult(" - " + fileSystemPaths[i]); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 removeFileSystem(fileSystemMapping, paths.BAR) | 141 removeFileSystem(fileSystemMapping, paths.BAR) |
| 142 | 142 |
| 143 InspectorTest.completeTest(); | 143 InspectorTest.completeTest(); |
| 144 } | 144 } |
| 145 </script> | 145 </script> |
| 146 </head> | 146 </head> |
| 147 <body onload="runTest()"> | 147 <body onload="runTest()"> |
| 148 <p>Tests FileSystemMapping</p> | 148 <p>Tests FileSystemMapping</p> |
| 149 </body> | 149 </body> |
| 150 </html> | 150 </html> |
| OLD | NEW |