Index: third_party/WebKit/LayoutTests/inspector/workspace-mapping.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html |
index 94f8076347fe2b70a0e15f715a5003c8663746c8..8e66b04c47dd9344ef2131494401f59e95a2cdf0 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html |
+++ b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html |
@@ -9,31 +9,26 @@ function test() |
var projects = {}; |
var workspace = new WebInspector.Workspace(); |
- function createUISourceCode(projectId, path) |
+ function createUISourceCode(projectId, relativePath) |
{ |
- if (projectId.startsWith("1:")) |
- projectId = projectId.substring(2); |
var project = projects[projectId]; |
if (!projects[projectId]) { |
- project = new WebInspector.ProjectStore(workspace, projectId, WebInspector.projectTypes.Network, ""); |
+ var projectType = projectId.startsWith("file") ? WebInspector.projectTypes.FileSystem : WebInspector.projectTypes.Network; |
+ project = new WebInspector.ProjectStore(workspace, projectId, projectType, ""); |
workspace.addProject(project); |
projects[projectId] = project; |
} |
- var uiSourceCode = project.createUISourceCode(path, WebInspector.resourceTypes.Script); |
+ var uiSourceCode = project.createUISourceCode(projectId +"/" + relativePath, WebInspector.resourceTypes.Script); |
project.addUISourceCode(uiSourceCode); |
} |
var fileSystemMapping = new WebInspector.FileSystemMapping(); |
- var fileSystemPath = "file:///var/www"; |
- var projectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystemPath); |
fileSystemMapping.addFileSystem("file:///var/www"); |
fileSystemMapping.addFileMapping("file:///var/www", "http://localhost/", "/localhost/"); |
- var fileSystemWorkspaceBinding = new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager, workspace); |
- var networkMapping = new WebInspector.NetworkMapping(WebInspector.targetManager, workspace, fileSystemWorkspaceBinding, fileSystemMapping); |
function dumpHasMappingForURL(url) |
{ |
- var result = networkMapping.hasMappingForNetworkURL(url) |
+ var result = fileSystemMapping.hasMappingForNetworkURL(url) |
if (result) |
InspectorTest.addResult(" url " + url + " is mapped."); |
else |
@@ -42,22 +37,22 @@ function test() |
function dumpUISourceCodeForURL(url) |
{ |
- var uiSourceCode = networkMapping.uiSourceCodeForURLForAnyTarget(url); |
+ var uiSourceCode = workspace.uiSourceCodeForURL(url); |
InspectorTest.addResult(" url " + url + " is mapped to " + (uiSourceCode ? uiSourceCode.url() : null)); |
} |
function dumpURLForPath(fileSystemPath, filePath) |
{ |
- var url = networkMapping._networkURLForFileSystemURL(fileSystemPath, fileSystemPath + "/" + filePath) |
+ var url = fileSystemMapping.networkURLForFileSystemURL(fileSystemPath, fileSystemPath + "/" + filePath) |
InspectorTest.addResult(" path " + fileSystemPath + " / " + filePath + " is mapped to " + (url ? url : null)); |
} |
- |
- createUISourceCode(projectId, "file:///var/www/localhost/index.html"); |
- createUISourceCode("1:http://www.example.com", "index.html"); |
- createUISourceCode("1:http://localhost", "index.html"); |
- createUISourceCode("1:http://localhost", "foo/index.html"); |
- createUISourceCode("1:https://localhost", "index.html"); |
+ createUISourceCode("file:///var/www", "localhost/index.html"); |
+ |
+ createUISourceCode("http://www.example.com", "index.html"); |
+ createUISourceCode("http://localhost", "index.html"); |
+ createUISourceCode("http://localhost", "foo/index.html"); |
+ createUISourceCode("https://localhost", "index.html"); |
dumpHasMappingForURL("http://www.example.com/index.html"); |
dumpHasMappingForURL("http://localhost/index.html"); |
@@ -69,6 +64,7 @@ function test() |
dumpUISourceCodeForURL("http://localhost/index.html"); |
dumpUISourceCodeForURL("http://localhost/foo/index.html"); |
dumpUISourceCodeForURL("https://localhost/index.html"); |
+ dumpUISourceCodeForURL("file:///var/www/localhost/index.html"); |
InspectorTest.addResult(""); |
dumpURLForPath("file:///home/example.com", "foo/index.html"); |