Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: third_party/WebKit/LayoutTests/inspector/workspace-mapping.html

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: bring sanity to workspace-mapping.html Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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");

Powered by Google App Engine
This is Rietveld 408576698