| 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 src="../http/tests/inspector/workspace-test.js"></script> | 4 <script src="../http/tests/inspector/workspace-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var uiSourceCodes = {}; | 8 var uiSourceCodes = {}; |
| 9 var projects = {}; | 9 var projects = {}; |
| 10 var workspace = new WebInspector.Workspace(); | 10 var workspace = new WebInspector.Workspace(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 26 var fileSystemMapping = new WebInspector.FileSystemMapping(); |
| 27 var fileSystemPath = "file:///var/www"; | 27 var fileSystemPath = "file:///var/www"; |
| 28 var projectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystem
Path); | 28 var projectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystem
Path); |
| 29 fileSystemMapping.addFileSystem("file:///var/www"); | 29 fileSystemMapping.addFileSystem("file:///var/www"); |
| 30 fileSystemMapping.addFileMapping("file:///var/www", "http://localhost/", "/l
ocalhost/"); | 30 fileSystemMapping.addFileMapping("file:///var/www", "http://localhost/", "/l
ocalhost/"); |
| 31 var fileSystemWorkspaceBinding = new WebInspector.FileSystemWorkspaceBinding
(WebInspector.isolatedFileSystemManager, workspace); | 31 var fileSystemWorkspaceBinding = new WebInspector.FileSystemWorkspaceBinding
(WebInspector.isolatedFileSystemManager, workspace); |
| 32 var networkMapping = new WebInspector.NetworkMapping(WebInspector.targetMana
ger, workspace, fileSystemWorkspaceBinding, fileSystemMapping); | 32 var networkMapping = new WebInspector.NetworkMapping(WebInspector.targetMana
ger, workspace, fileSystemWorkspaceBinding, fileSystemMapping); |
| 33 | 33 |
| 34 function dumpHasMappingForURL(url) | 34 function dumpHasMappingForURL(url) |
| 35 { | 35 { |
| 36 var result = networkMapping.hasMappingForURL(url) | 36 var result = networkMapping.hasMappingForNetworkURL(url) |
| 37 if (result) | 37 if (result) |
| 38 InspectorTest.addResult(" url " + url + " is mapped."); | 38 InspectorTest.addResult(" url " + url + " is mapped."); |
| 39 else | 39 else |
| 40 InspectorTest.addResult(" url " + url + " is not mapped."); | 40 InspectorTest.addResult(" url " + url + " is not mapped."); |
| 41 } | 41 } |
| 42 | 42 |
| 43 function dumpUISourceCodeForURL(url) | 43 function dumpUISourceCodeForURL(url) |
| 44 { | 44 { |
| 45 var uiSourceCode = networkMapping.uiSourceCodeForURLForAnyTarget(url); | 45 var uiSourceCode = networkMapping.uiSourceCodeForURLForAnyTarget(url); |
| 46 InspectorTest.addResult(" url " + url + " is mapped to " + (uiSourceC
ode ? uiSourceCode.uri() : null)); | 46 InspectorTest.addResult(" url " + url + " is mapped to " + (uiSourceC
ode ? uiSourceCode.url() : null)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 function dumpURLForPath(fileSystemPath, filePath) | 49 function dumpURLForPath(fileSystemPath, filePath) |
| 50 { | 50 { |
| 51 var url = networkMapping._urlForPath(fileSystemPath, fileSystemPath + "/
" + filePath) | 51 var url = networkMapping._networkURLForFileSystemURL(fileSystemPath, fil
eSystemPath + "/" + filePath) |
| 52 InspectorTest.addResult(" path " + fileSystemPath + " / " + filePath
+ " is mapped to " + (url ? url : null)); | 52 InspectorTest.addResult(" path " + fileSystemPath + " / " + filePath
+ " is mapped to " + (url ? url : null)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 createUISourceCode(projectId, "file:///var/www/localhost/index.html"); | 55 createUISourceCode(projectId, "file:///var/www/localhost/index.html"); |
| 56 | 56 |
| 57 createUISourceCode("1:http://www.example.com", "index.html"); | 57 createUISourceCode("1:http://www.example.com", "index.html"); |
| 58 createUISourceCode("1:http://localhost", "index.html"); | 58 createUISourceCode("1:http://localhost", "index.html"); |
| 59 createUISourceCode("1:http://localhost", "foo/index.html"); | 59 createUISourceCode("1:http://localhost", "foo/index.html"); |
| 60 createUISourceCode("1:https://localhost", "index.html"); | 60 createUISourceCode("1:https://localhost", "index.html"); |
| 61 | 61 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 78 dumpURLForPath("file:///home/foo", "index.html"); | 78 dumpURLForPath("file:///home/foo", "index.html"); |
| 79 | 79 |
| 80 InspectorTest.completeTest(); | 80 InspectorTest.completeTest(); |
| 81 } | 81 } |
| 82 </script> | 82 </script> |
| 83 </head> | 83 </head> |
| 84 <body onload="runTest()"> | 84 <body onload="runTest()"> |
| 85 <p>Tests workspace mappings</p> | 85 <p>Tests workspace mappings</p> |
| 86 </body> | 86 </body> |
| 87 </html> | 87 </html> |
| OLD | NEW |