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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="../http/tests/inspector/debugger-test.js"></script> 4 <script src="../http/tests/inspector/debugger-test.js"></script>
5 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script> 5 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script>
6 <script> 6 <script>
7 function test() 7 function test()
8 { 8 {
9 function fileSystemUISourceCodes() 9 function fileSystemUISourceCodes()
10 { 10 {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 var dir = fs.root.mkdir("html"); 204 var dir = fs.root.mkdir("html");
205 dir.addFile("foo.js", ""); 205 dir.addFile("foo.js", "");
206 fs.reportCreated(dumpFileSystem); 206 fs.reportCreated(dumpFileSystem);
207 207
208 function dumpFileSystem() 208 function dumpFileSystem()
209 { 209 {
210 InspectorTest.addResult("-- Original tree --"); 210 InspectorTest.addResult("-- Original tree --");
211 dumpWorkspaceUISourceCodes(); 211 dumpWorkspaceUISourceCodes();
212 212
213 dir.addFile("bar.js", ""); 213 dir.addFile("bar.js", "");
214 InspectorFrontendHost.events.dispatchEventToListeners(InspectorF rontendHostAPI.Events.FileSystemFilesChanged, ["/var/www4/html/bar.js"]); 214 InspectorFrontendHost.events.dispatchEventToListeners(InspectorF rontendHostAPI.Events.FileSystemFilesChangedAddedRemoved, {
215 changed: [],
216 added:["/var/www4/html/bar.js"],
217 removed: []
218 });
215 219
216 InspectorTest.addResult("-- File added externally --"); 220 InspectorTest.addResult("-- File added externally --");
217 dumpWorkspaceUISourceCodes(); 221 dumpWorkspaceUISourceCodes();
218 fs.reportRemoved(); 222 fs.reportRemoved();
219 next(); 223 next();
220 } 224 }
221 }, 225 },
222 226
223 function testGitFolders(next) 227 function testGitFolders(next)
224 { 228 {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 next(); 277 next();
274 } 278 }
275 279
276 function dumpMetadata(label, metadata) 280 function dumpMetadata(label, metadata)
277 { 281 {
278 InspectorTest.addResult(label); 282 InspectorTest.addResult(label);
279 InspectorTest.addResult(" content size: " + metadata.contentS ize); 283 InspectorTest.addResult(" content size: " + metadata.contentS ize);
280 InspectorTest.addResult(" modification time: " + metadata.mod ificationTime.toISOString()); 284 InspectorTest.addResult(" modification time: " + metadata.mod ificationTime.toISOString());
281 } 285 }
282 }, 286 },
287
288 function testFileRename(next)
289 {
290 var fs = new InspectorTest.TestFileSystem("file:///var/www3");
291 var file = fs.root.mkdir("test").addFile("hello.js", "123456");
292 fs.reportCreated(function() { });
293 InspectorTest.waitForScriptSource("hello.js", onUISourceCode);
294 var uiSourceCode;
295 var originalURL;
296 function onUISourceCode(sourceCode)
297 {
298 uiSourceCode = sourceCode;
299 originalURL = uiSourceCode.url();
300 InspectorTest.addResult('URL before rename: ' + originalURL);
301 uiSourceCode.rename('goodbye.js', renamed);
302 }
303
304 function renamed()
305 {
306 InspectorTest.addResult('URL after rename: ' + uiSourceCode.url( ));
307 if (uiSourceCode.project().workspace().uiSourceCodeForURL(origin alURL))
308 InspectorTest.addResult('ERROR: Still found original URL in workspace.');
309 if (!uiSourceCode.project().workspace().uiSourceCodeForURL(uiSou rceCode.url()))
310 InspectorTest.addResult('ERROR: Could not find new URL in wo rkspace.');
311 next();
312 }
313 }
283 ]); 314 ]);
284 }; 315 };
285 </script> 316 </script>
286 </head> 317 </head>
287 <body onload="runTest()"> 318 <body onload="runTest()">
288 <p>Tests file system project.</p> 319 <p>Tests file system project.</p>
289 </body> 320 </body>
290 </html> 321 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698