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

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

Issue 2077363003: DevTools: similarly to the way we match scripts ignoring sourceurl comments, ignore framework-speci… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test added Created 4 years, 6 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/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> 8 <script>
9 function test() 9 function test()
10 { 10 {
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 fs.reportCreated(fileSystemCreated); 371 fs.reportCreated(fileSystemCreated);
372 372
373 function fileSystemCreated() 373 function fileSystemCreated()
374 { 374 {
375 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h1 /foo.js", WebInspector.resourceTypes.Script, "<foo content>", target); 375 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h1 /foo.js", WebInspector.resourceTypes.Script, "<foo content>", target);
376 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h2 /bar.js", WebInspector.resourceTypes.Script, "<bar content>", target); 376 InspectorTest.addMockUISourceCodeViaNetwork("http://localhost/h2 /bar.js", WebInspector.resourceTypes.Script, "<bar content>", target);
377 dumpFileSystemUISourceCodesMappings(); 377 dumpFileSystemUISourceCodesMappings();
378 fs.reportRemoved(); 378 fs.reportRemoved();
379 next(); 379 next();
380 } 380 }
381 },
382
383 function testNodeJSWrapper(next)
384 {
385 createWorkspaceWithTarget();
386 InspectorTest.addResult("Adding file system.");
387 var fs = new InspectorTest.TestFileSystem("file:///var/www");
388 var content = "var a = 1;"
389 var folder = fs.root.mkdir("html");
390 folder.addFile("foo.js", "#!/usr/bin/env node;\n" + content);
391 folder.addFile("bar.js", content);
392 fs.root.addFile(".devtools", JSON.stringify({ mappings: [ { folder: "/html/", url: "http://localhost/h1/" } ]}));
393 fs.reportCreated(fileSystemCreated);
394
395 function fileSystemCreated()
396 {
397 debugger;
398 var uiSourceCodeFoo = InspectorTest.testWorkspace.uiSourceCode(f ileSystemProjectId, "file:///var/www/html/foo.js");
399 var uiSourceCodeBar = InspectorTest.testWorkspace.uiSourceCode(f ileSystemProjectId, "file:///var/www/html/bar.js");
400
401 var nodePrefix = "(function (exports, require, module, __filenam e, __dirname) { \n";
402 var nodeSuffix = "\n});";
403
404 var scriptFoo = InspectorTest.createScriptMock("http://localhost /h1/foo.js", 0, 0, false, nodePrefix + content + nodeSuffix, InspectorTest.testT argetManager.targets()[0]);
405 defaultScriptMapping.addScript(scriptFoo);
406 resourceScriptMapping.addScript(scriptFoo);
407 InspectorTest.addResult("Is diverged: " + resourceScriptMapping. scriptFile(uiSourceCodeFoo)._isDiverged());
408
409 var scriptBar = InspectorTest.createScriptMock("http://localhost /h1/bar.js", 0, 0, false, nodePrefix + content + nodeSuffix, InspectorTest.testT argetManager.targets()[0]);
410 defaultScriptMapping.addScript(scriptBar);
411 resourceScriptMapping.addScript(scriptBar);
412 InspectorTest.addResult("Is diverged: " + resourceScriptMapping. scriptFile(uiSourceCodeBar)._isDiverged());
413 next();
414 }
381 } 415 }
382 ]); 416 ]);
383 }; 417 };
384 </script> 418 </script>
385 </head> 419 </head>
386 <body onload="runTest()"> 420 <body onload="runTest()">
387 <p>Tests file system project mappings.</p> 421 <p>Tests file system project mappings.</p>
388 </body> 422 </body>
389 </html> 423 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698