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

Unified Diff: third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js

Issue 1813943003: DevTools: automatic mapping detection is broken for cases with specific file paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added expectations Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
index f1a185167cde32a2eb2a6e0c34340aee91551a66..337d2136d33e7732ff3aec48f0896733020a40f8 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
@@ -311,9 +311,14 @@ WebInspector.FileSystemMapping.prototype = {
if (filePathCharacter === "/")
commonPathSuffixLength = i;
}
- var pathPrefix = filePath.substring(fileSystemPath.length, filePath.length - commonPathSuffixLength);
+ var from = fileSystemPath.length;
+ var to = filePath.length - commonPathSuffixLength;
+ var pathPrefix = filePath.substring(from, to);
var urlPrefix = url.substr(0, url.length - commonPathSuffixLength);
- this.addFileMapping(fileSystemPath, urlPrefix, pathPrefix);
+ if (to >= from)
+ this.addFileMapping(fileSystemPath, urlPrefix, pathPrefix);
+ else
+ this.addFileMapping(fileSystemPath, urlPrefix + pathPrefix, "/");
},
resetForTesting: function()
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698