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

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

Issue 432753003: DevTools: Fix url assignment when renaming files in workspace (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added a test and fixed correctly Created 6 years, 5 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: LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
diff --git a/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html b/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
index 19b240eee29766f9733bc7c8a8e27d7fed05f18d..fe5dbd772675c01da54fbb55ae29658254265120 100644
--- a/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
+++ b/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
@@ -339,6 +339,46 @@ function test()
next();
}
},
+
+ function testURLAfterRenaming(next)
+ {
+ function uiSourceCodeAdded(uiSourceCode) { }
+
+ var fileSystemPath = "/var/www";
+ var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystemPath);
+ var files = {"/html/foo.js": "<foo content>", "/bar.js": "<bar content>", "/foo/bar/baz.js": "<baz content>"};
+ createObjects();
+ InspectorTest.addResult("Adding file system.");
+ manager.addMockFileSystem(fileSystemPath);
+ InspectorTest.addResult("Adding file system mapping.");
+ InspectorTest.testFileSystemMapping.addFileMapping(fileSystemPath, "http://localhost/", "/");
+ InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdded, 3);
+ manager.addFiles(fileSystemPath, files);
+
+ InspectorTest.addResult("Renaming files:");
+ var uiSourceCodes = InspectorTest.testWorkspace.uiSourceCodes();
+ var index = 0;
+ var oldURL;
+ renameNextFile();
+
+ function renameNextFile()
+ {
+ var uiSourceCode = uiSourceCodes[index];
+ oldURL = uiSourceCode.url;
+ uiSourceCodes[index].rename("newName.js", fileRenamed);
+ }
+
+ function fileRenamed()
+ {
+ var uiSourceCode = uiSourceCodes[index];
+ InspectorTest.addResult(" uiSourceCode URL change after renaming: " + oldURL + " -> " + uiSourceCode.url);
+ ++index;
+ if (index < uiSourceCodes.length)
+ renameNextFile();
+ else
+ next();
+ }
+ },
]);
};
</script>

Powered by Google App Engine
This is Rietveld 408576698