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

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

Issue 2651043006: DevTools: Remove files in the navigator when they are deleted externally (Closed)
Patch Set: fix test Created 3 years, 11 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/file-system-project.html
diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-project.html b/third_party/WebKit/LayoutTests/inspector/file-system-project.html
index 7402cefb61e27da4aaad11a6d392c6851343b506..60d88ffdebd201d7329d841f446814674eb2fae6 100644
--- a/third_party/WebKit/LayoutTests/inspector/file-system-project.html
+++ b/third_party/WebKit/LayoutTests/inspector/file-system-project.html
@@ -211,7 +211,11 @@ function test()
dumpWorkspaceUISourceCodes();
dir.addFile("bar.js", "");
- InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.FileSystemFilesChanged, ["/var/www4/html/bar.js"]);
+ InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.FileSystemFilesChangedAddedRemoved, {
+ changed: [],
+ added:["/var/www4/html/bar.js"],
+ removed: []
+ });
InspectorTest.addResult("-- File added externally --");
dumpWorkspaceUISourceCodes();
@@ -236,7 +240,7 @@ function test()
function dumpGitFolders()
{
var isolatedFileSystem = Workspace.isolatedFileSystemManager.fileSystem("file:///var/www3");
- var folders = isolatedFileSystem.gitFolders();
+ var folders = isolatedFileSystem.initialGitFolders();
folders.sort();
for (var gitFolder of folders)
InspectorTest.addResult(gitFolder);
@@ -280,6 +284,33 @@ function test()
InspectorTest.addResult(" modification time: " + metadata.modificationTime.toISOString());
}
},
+
+ function testFileRename(next)
+ {
+ var fs = new InspectorTest.TestFileSystem("file:///var/www3");
+ var file = fs.root.mkdir("test").addFile("hello.js", "123456");
+ fs.reportCreated(function() { });
+ InspectorTest.waitForScriptSource("hello.js", onUISourceCode);
+ var uiSourceCode;
+ var originalURL;
+ function onUISourceCode(sourceCode)
+ {
+ uiSourceCode = sourceCode;
+ originalURL = uiSourceCode.url();
+ InspectorTest.addResult('URL before rename: ' + originalURL);
+ uiSourceCode.rename('goodbye.js', renamed);
+ }
+
+ function renamed()
+ {
+ InspectorTest.addResult('URL after rename: ' + uiSourceCode.url());
+ if (uiSourceCode.project().workspace().uiSourceCodeForURL(originalURL))
+ InspectorTest.addResult('ERROR: Still found original URL in workspace.');
+ if (!uiSourceCode.project().workspace().uiSourceCodeForURL(uiSourceCode.url()))
+ InspectorTest.addResult('ERROR: Could not find new URL in workspace.');
+ next();
+ }
+ }
]);
};
</script>

Powered by Google App Engine
This is Rietveld 408576698