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

Side by Side 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, 4 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 | Annotate | Revision Log
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/workspace-test.js"></script> 5 <script src="../../../http/tests/inspector/workspace-test.js"></script>
6 <script src="../../../http/tests/inspector/isolated-filesystem-test.js"></script > 6 <script src="../../../http/tests/inspector/isolated-filesystem-test.js"></script >
7 <script src="../../../http/tests/inspector/live-edit-test.js"></script> 7 <script src="../../../http/tests/inspector/live-edit-test.js"></script>
8 <script src="resources/edit-me.js"></script> 8 <script src="resources/edit-me.js"></script>
9 <script> 9 <script>
10 function test() 10 function test()
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 var project = InspectorTest.testWorkspace.uiSourceCodes()[0].project (); 332 var project = InspectorTest.testWorkspace.uiSourceCodes()[0].project ();
333 InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace. Events.ProjectRemoved, projectRemoved); 333 InspectorTest.testWorkspace.addEventListener(WebInspector.Workspace. Events.ProjectRemoved, projectRemoved);
334 project.remove(); 334 project.remove();
335 335
336 function projectRemoved() 336 function projectRemoved()
337 { 337 {
338 InspectorTest.addResult("Received project removed event."); 338 InspectorTest.addResult("Received project removed event.");
339 next(); 339 next();
340 } 340 }
341 }, 341 },
342
343 function testURLAfterRenaming(next)
344 {
345 function uiSourceCodeAdded(uiSourceCode) { }
346
347 var fileSystemPath = "/var/www";
348 var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.pr ojectId(fileSystemPath);
349 var files = {"/html/foo.js": "<foo content>", "/bar.js": "<bar conte nt>", "/foo/bar/baz.js": "<baz content>"};
350 createObjects();
351 InspectorTest.addResult("Adding file system.");
352 manager.addMockFileSystem(fileSystemPath);
353 InspectorTest.addResult("Adding file system mapping.");
354 InspectorTest.testFileSystemMapping.addFileMapping(fileSystemPath, " http://localhost/", "/");
355 InspectorTest.waitForWorkspaceUISourceCodeAddedEvent(uiSourceCodeAdd ed, 3);
356 manager.addFiles(fileSystemPath, files);
357
358 InspectorTest.addResult("Renaming files:");
359 var uiSourceCodes = InspectorTest.testWorkspace.uiSourceCodes();
360 var index = 0;
361 var oldURL;
362 renameNextFile();
363
364 function renameNextFile()
365 {
366 var uiSourceCode = uiSourceCodes[index];
367 oldURL = uiSourceCode.url;
368 uiSourceCodes[index].rename("newName.js", fileRenamed);
369 }
370
371 function fileRenamed()
372 {
373 var uiSourceCode = uiSourceCodes[index];
374 InspectorTest.addResult(" uiSourceCode URL change after renam ing: " + oldURL + " -> " + uiSourceCode.url);
375 ++index;
376 if (index < uiSourceCodes.length)
377 renameNextFile();
378 else
379 next();
380 }
381 },
342 ]); 382 ]);
343 }; 383 };
344 </script> 384 </script>
345 </head> 385 </head>
346 <body onload="runTest()"> 386 <body onload="runTest()">
347 <p>Tests file system project mappings.</p> 387 <p>Tests file system project mappings.</p>
348 </body> 388 </body>
349 </html> 389 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698