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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html

Issue 2533183002: [DevTools] Remove workspace-test.js part2. (Closed)
Patch Set: Created 4 years, 1 month 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/sources/debugger/file-system-project-mapping.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
deleted file mode 100644
index b557818ed30da29fc0cb06c16cb1a182ae128de4..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
+++ /dev/null
@@ -1,166 +0,0 @@
-<html>
-<head>
-<script src="../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../http/tests/inspector/debugger-test.js"></script>
-<script src="../../../http/tests/inspector/workspace-test.js"></script>
-<script src="../../../http/tests/inspector/isolated-filesystem-test.js"></script>
-<script src="../../../http/tests/inspector/live-edit-test.js"></script>
-<script>
-
-function test()
-{
- var target;
- var resourceScriptMapping;
- var defaultScriptMapping;
- var persistence;
- var fileSystemProjectId = Persistence.FileSystemWorkspaceBinding.projectId("file:///var/www");
-
- function createWorkspaceWithTarget()
- {
- target = InspectorTest.createWorkspaceWithTarget(false);
- var entry = InspectorTest.testDebuggerWorkspaceBinding._targetToData.get(target);
- resourceScriptMapping = entry._resourceMapping;
- defaultScriptMapping = entry._defaultMapping;
- if (persistence)
- persistence.dispose();
- persistence = new Persistence.Persistence(InspectorTest.testWorkspace, Bindings.breakpointManager, Workspace.fileSystemMapping);
- }
-
- function dumpFileSystemUISourceCodesMappings()
- {
- var uiSourceCodes = InspectorTest.testWorkspace.project(fileSystemProjectId).uiSourceCodes();
- InspectorTest.addResult("UISourceCode uri to url mappings:");
- for (var uiSourceCode of uiSourceCodes) {
- var binding = persistence.binding(uiSourceCode);
- var url = binding ? binding.network.url() : "";
- InspectorTest.addResult(" " + uiSourceCode.url() + " -> " + url);
- }
- }
-
- InspectorTest.runTestSuite([
- function testAutomaticMapping(next)
- {
- createWorkspaceWithTarget();
-
- InspectorTest.addResult("Adding file system.");
- var fs = new InspectorTest.TestFileSystem("file:///var/www");
- fs.root.mkdir("html").addFile("foo.js", "<foo content>");
- fs.root.addFile("bar.js", "<bar content>");
- fs.reportCreated(fileSystemCreated1);
- var networkUISourceCode;
-
- function fileSystemCreated1()
- {
- InspectorTest.addResult("Adding network resource.");
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target);
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target);
- dumpFileSystemUISourceCodesMappings();
-
- var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(fileSystemProjectId, "file:///var/www/html/foo.js");
- networkUISourceCode = InspectorTest.testWorkspace.uiSourceCode(Bindings.NetworkProject.projectId(target, target.resourceTreeModel.mainFrame, false), "http://localhost/html/foo.js");
- InspectorTest.addResult("Adding mapping between network and file system resources.");
-
- var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
- Workspace.fileSystemMapping.addMappingForResource(networkUISourceCode.url(), fileSystemPath, uiSourceCode.url());
- var setting = JSON.stringify(Workspace.fileSystemMapping._fileSystemMappingSetting.get());
-
- InspectorTest.addResult("Emulate reloading inspector.");
- fs.reportRemoved();
- createWorkspaceWithTarget();
- Workspace.fileSystemMapping._fileSystemMappingSetting.set(JSON.parse(setting));
- Workspace.fileSystemMapping._loadFromSettings();
- fs.reportCreated(fileSystemCreated2);
- }
-
- function fileSystemCreated2()
- {
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target);
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target);
-
- dumpFileSystemUISourceCodesMappings();
-
- InspectorTest.addResult("Removing mapping between network and file system resources.");
- var uiSourceCode = InspectorTest.testWorkspace.uiSourceCode(fileSystemProjectId, "file:///var/www/html/foo.js");
- Workspace.fileSystemMapping.removeMappingForURL(uiSourceCode.url());
-
- InspectorTest.addResult("Emulate reloading inspector.");
- fs.reportRemoved();
- createWorkspaceWithTarget();
- fs.reportCreated(fileSystemCreated3);
- }
-
- function fileSystemCreated3()
- {
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/html/foo.js", Common.resourceTypes.Script, "<foo content>", target);
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/bar.js", Common.resourceTypes.Script, "<foo content>", target);
- dumpFileSystemUISourceCodesMappings();
-
- Workspace.fileSystemMapping.removeMappingForURL(networkUISourceCode.url());
- fs.reportRemoved();
- next();
- }
- },
-
- function testRemoveProject(next)
- {
- function dumpWorkspaceUISourceCodes()
- {
- InspectorTest.addResult("Dumping uiSourceCodes origin URLs:");
- var uiSourceCodes = InspectorTest.testWorkspace.uiSourceCodes();
- for (var i = 0; i < uiSourceCodes.length; ++i)
- InspectorTest.addResult(" - " + uiSourceCodes[i].url());
- }
-
- createWorkspaceWithTarget();
-
- InspectorTest.addResult("Adding file system.");
- var fs = new InspectorTest.TestFileSystem("file:///var/www");
- fs.root.addFile("foo.js", "");
- fs.reportCreated(fileSystemCreated);
-
- function fileSystemCreated()
- {
- dumpWorkspaceUISourceCodes();
- InspectorTest.addResult("Removing project:");
- InspectorTest.testWorkspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, projectRemoved);
- InspectorTest.testTargetManager.removeTarget(target);
- target = null;
- }
-
- function projectRemoved()
- {
- InspectorTest.testWorkspace.removeEventListener(Workspace.Workspace.Events.ProjectRemoved, projectRemoved);
- InspectorTest.addResult("Received project removed event.");
- fs.reportRemoved();
- setImmediate(next);
- }
- },
-
- function testProjectBasedMapping(next)
- {
- createWorkspaceWithTarget();
-
- InspectorTest.addResult("Adding file system.");
- var fs = new InspectorTest.TestFileSystem("file:///var/www");
- fs.root.mkdir("html").addFile("foo.js", "<foo content>");
- fs.root.mkdir("html2").addFile("bar.js", "<bar content>");
- fs.root.addFile(".devtools", JSON.stringify({ mappings: [ { folder: "/html/", url: "http://localhost/h1/" }, { folder: "/html2/", url: "http://localhost/h2/" } ]}));
- fs.reportCreated(fileSystemCreated);
-
- function fileSystemCreated()
- {
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h1/foo.js", Common.resourceTypes.Script, "<foo content>", target);
- InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h2/bar.js", Common.resourceTypes.Script, "<bar content>", target);
- dumpFileSystemUISourceCodesMappings();
- fs.reportRemoved();
- next();
- }
- }
- ]);
-};
-</script>
-</head>
-<body onload="runTest()">
-<p>Tests file system project mappings.</p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698