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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
index 29e47e34ffe1d92a981665a1c80d9168e1d431cd..c3bc705a95e15c0c490d781151f1dc1fbe4ed869 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-mapping.html
@@ -378,6 +378,40 @@ function test()
fs.reportRemoved();
next();
}
+ },
+
+ function testNodeJSWrapper(next)
+ {
+ createWorkspaceWithTarget();
+ InspectorTest.addResult("Adding file system.");
+ var fs = new InspectorTest.TestFileSystem("file:///var/www");
+ var content = "var a = 1;"
+ var folder = fs.root.mkdir("html");
+ folder.addFile("foo.js", "#!/usr/bin/env node;\n" + content);
+ folder.addFile("bar.js", content);
+ fs.root.addFile(".devtools", JSON.stringify({ mappings: [ { folder: "/html/", url: "http://localhost/h1/" } ]}));
+ fs.reportCreated(fileSystemCreated);
+
+ function fileSystemCreated()
+ {
+ debugger;
+ var uiSourceCodeFoo = InspectorTest.testWorkspace.uiSourceCode(fileSystemProjectId, "file:///var/www/html/foo.js");
+ var uiSourceCodeBar = InspectorTest.testWorkspace.uiSourceCode(fileSystemProjectId, "file:///var/www/html/bar.js");
+
+ var nodePrefix = "(function (exports, require, module, __filename, __dirname) { \n";
+ var nodeSuffix = "\n});";
+
+ var scriptFoo = InspectorTest.createScriptMock("http://localhost/h1/foo.js", 0, 0, false, nodePrefix + content + nodeSuffix, InspectorTest.testTargetManager.targets()[0]);
+ defaultScriptMapping.addScript(scriptFoo);
+ resourceScriptMapping.addScript(scriptFoo);
+ InspectorTest.addResult("Is diverged: " + resourceScriptMapping.scriptFile(uiSourceCodeFoo)._isDiverged());
+
+ var scriptBar = InspectorTest.createScriptMock("http://localhost/h1/bar.js", 0, 0, false, nodePrefix + content + nodeSuffix, InspectorTest.testTargetManager.targets()[0]);
+ defaultScriptMapping.addScript(scriptBar);
+ resourceScriptMapping.addScript(scriptBar);
+ InspectorTest.addResult("Is diverged: " + resourceScriptMapping.scriptFile(uiSourceCodeBar)._isDiverged());
+ next();
+ }
}
]);
};

Powered by Google App Engine
This is Rietveld 408576698