diff options
author | pfeldman <pfeldman@chromium.org> | 2015-12-31 14:39:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-31 22:41:03 +0000 |
commit | cf0a07b13661965f1c3df642306850b69cfeda8c (patch) | |
tree | 26eaeeccd1e66596cdd0304ff5b7672cccef8170 | |
parent | 29de2c811de5e5fa6eb238bbcd45796907c037bd (diff) | |
download | chromium_src-cf0a07b13661965f1c3df642306850b69cfeda8c.zip chromium_src-cf0a07b13661965f1c3df642306850b69cfeda8c.tar.gz chromium_src-cf0a07b13661965f1c3df642306850b69cfeda8c.tar.bz2 |
DevTools: use complete normalized url as a filesystem path in workspace.
TBR=dgozman
BUG=571393
Review URL: https://codereview.chromium.org/1552033002
Cr-Commit-Position: refs/heads/master@{#367253}
19 files changed, 174 insertions, 163 deletions
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html index 3c8fe8e..896e1bd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/edit-css-with-source-url.html @@ -22,7 +22,7 @@ function test() InspectorTest.runTestSuite([ function testEditingRulesInElementsPanelDoesNotAddSourceURLToOriginalFile(next) { - var fileSystemPath = "/var/www"; + var fileSystemPath = "file:///var/www"; function dumpUISourceCodeContents() { diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html index 2ca60bd..2bf2629 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/elements/styles/update-locations-on-filesystem-scss-load.html @@ -16,7 +16,7 @@ function loadCSS() function test() { InspectorTest.addResult("Creating filesystem with the SCSS file..."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.addFile("update-locations-on-filesystem-scss-load.scss", ["a {", " foo: bar;", "/* COMMENT */", " font-size: 12px;", "}"].join("\n")); fs.addFileMapping(WebInspector.ParsedURL.completeURL(InspectorTest.resourceTreeModel.inspectedPageURL(), "resources/source/"), "/"); fs.reportCreated(fileSystemCreated); diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html index 78b5b03a..01c072a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-in-files.html @@ -11,7 +11,7 @@ function test() { var scope = new WebInspector.SourcesSearchScope(); var names = ["search.html", "search.js", "search.css"]; - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); var promises = []; for (var name of names) diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html index 2e9b4e7..6539139 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/search/sources-search-scope-many-projects.html @@ -10,7 +10,7 @@ function test() { var scope = new WebInspector.SourcesSearchScope(); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); var names = ["search.html", "search.js", "search.css"]; var resources = {}; var jsFileSystemUISourceCode; diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt index 6bad388..399ab43 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-expected.txt @@ -3,61 +3,61 @@ Tests FileSystemMapping Testing file system mapping. file system paths: -Adding file system /home/username/projects/foo +Adding file system file:///home/username/projects/foo Testing file system mapping. file system paths: - - /home/username/projects/foo + - file:///home/username/projects/foo -Adding file system /home/username/projects/bar +Adding file system file:///home/username/projects/bar Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar + - file:///home/username/projects/foo + - file:///home/username/projects/bar -Adding file system /www/site1 +Adding file system file:///www/site1 Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar - - /www/site1 + - file:///home/username/projects/foo + - file:///home/username/projects/bar + - file:///www/site1 -Adding file mapping (/www/site1, http://localhost/, /) +Adding file mapping (file:///www/site1, http://localhost/, /) Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - file:///home/username/projects/foo + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} -Adding file mapping (/www/site1, http://www.foo.com/, /foo/) +Adding file mapping (file:///www/site1, http://www.foo.com/, /foo/) Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} -Adding file mapping (/home/username/projects/foo, http://www.example.com/bar/, /foo/) +Adding file mapping (file:///home/username/projects/foo, http://www.example.com/bar/, /foo/) Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} -Adding file mapping for resource (http://www.bar.com/foo/folder/42.js, /home/username/projects/foo, file:///home/username/projects/foo/baz/folder/42.js) +Adding file mapping for resource (http://www.bar.com/foo/folder/42.js, file:///home/username/projects/foo, file:///home/username/projects/foo/baz/folder/42.js) Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.bar.com/foo/","pathPrefix":"/baz/","configurable":true} - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.bar.com/foo/","pathPrefix":"/baz/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} Testing mappings for url: Has mapping for 'http://www.bar.com/foo/folder/42.js': true @@ -87,60 +87,60 @@ Testing mappings for path: Creating another file system mapping. Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.bar.com/foo/","pathPrefix":"/baz/","configurable":true} - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.bar.com/foo/","pathPrefix":"/baz/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} Removing file mapping for url http://www.bar.com/foo/folder/42.js Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://localhost/","pathPrefix":"/","configurable":true} + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} -Removing file mapping (/www/site1, http://localhost/, /) +Removing file mapping (file:///www/site1, http://localhost/, /) Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - /home/username/projects/bar - - /www/site1 - - {"fileSystemPath":"/www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 + - {"fileSystemPath":"file:///www/site1","urlPrefix":"http://www.foo.com/","pathPrefix":"/foo/","configurable":true} -Removing file mapping (/www/site1, http://www.foo.com/, /foo/) +Removing file mapping (file:///www/site1, http://www.foo.com/, /foo/) Testing file system mapping. file system paths: - - /home/username/projects/foo - - {"fileSystemPath":"/home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} - - /home/username/projects/bar - - /www/site1 + - file:///home/username/projects/foo + - {"fileSystemPath":"file:///home/username/projects/foo","urlPrefix":"http://www.example.com/bar/","pathPrefix":"/foo/","configurable":true} + - file:///home/username/projects/bar + - file:///www/site1 -Removing file mapping (/home/username/projects/foo, http://www.example.com/bar/, /foo/) +Removing file mapping (file:///home/username/projects/foo, http://www.example.com/bar/, /foo/) Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar - - /www/site1 + - file:///home/username/projects/foo + - file:///home/username/projects/bar + - file:///www/site1 -Removing file system /www/site1 +Removing file system file:///www/site1 Testing file system mapping. file system paths: - - /home/username/projects/foo - - /home/username/projects/bar + - file:///home/username/projects/foo + - file:///home/username/projects/bar -Removing file system /home/username/projects/foo +Removing file system file:///home/username/projects/foo Testing file system mapping. file system paths: - - /home/username/projects/bar + - file:///home/username/projects/bar -Removing file system /home/username/projects/bar +Removing file system file:///home/username/projects/bar Testing file system mapping. file system paths: diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html index a274c76..d8ecf19 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-mapping-overrides.html @@ -8,34 +8,34 @@ function test() function testFileSystemClashDirectOrder(next) { var fileSystemMapping = new WebInspector.FileSystemMapping(); - fileSystemMapping.addFileSystem("/Source/devtools"); + fileSystemMapping.addFileSystem("file:///Source/devtools"); - fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools", "chrome-devtools://devtools/bundled/wrong_url", "/"); - fileSystemMapping.addFileMapping("/Source/devtools", "http://localhost:1234/right_url", "/"); + fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "chrome-devtools://devtools/bundled/wrong_url", "/"); + fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/right_url", "/"); - InspectorTest.addResult(fileSystemMapping.urlForPath("/Source/devtools", "file:///Source/devtools/file.txt")); + InspectorTest.addResult(fileSystemMapping.urlForPath("file:///Source/devtools", "file:///Source/devtools/file.txt")); next(); }, function testFileSystemClashReversedOrder(next) { var fileSystemMapping = new WebInspector.FileSystemMapping(); - fileSystemMapping.addFileSystem("/Source/devtools"); + fileSystemMapping.addFileSystem("file:///Source/devtools"); - fileSystemMapping.addFileMapping("/Source/devtools", "http://localhost:1234/right_url", "/"); - fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools", "chrome-devtools://devtools/wrong_url", "/"); + fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/right_url", "/"); + fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "chrome-devtools://devtools/wrong_url", "/"); - InspectorTest.addResult(fileSystemMapping.urlForPath("/Source/devtools", "file:///Source/devtools/file.txt")); + InspectorTest.addResult(fileSystemMapping.urlForPath("file:///Source/devtools", "file:///Source/devtools/file.txt")); next(); }, function testNetworkClashDirectOrder(next) { var fileSystemMapping = new WebInspector.FileSystemMapping(); - fileSystemMapping.addFileSystem("/Source/devtools"); + fileSystemMapping.addFileSystem("file:///Source/devtools"); - fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools", "http://localhost:1234/front_end", "/wrong"); - fileSystemMapping.addFileMapping("/Source/devtools", "http://localhost:1234/front_end", "/right"); + fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/wrong"); + fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/right"); InspectorTest.addResult(fileSystemMapping.fileForURL("http://localhost:1234/front_end/file.txt").fileURL); next(); @@ -44,10 +44,10 @@ function test() function testNetworkClashReversedOrder(next) { var fileSystemMapping = new WebInspector.FileSystemMapping(); - fileSystemMapping.addFileSystem("/Source/devtools"); + fileSystemMapping.addFileSystem("file:///Source/devtools"); - fileSystemMapping.addFileMapping("/Source/devtools", "http://localhost:1234/front_end", "/right"); - fileSystemMapping.addNonConfigurableFileMapping("/Source/devtools", "http://localhost:1234/front_end", "/wrong"); + fileSystemMapping.addFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/right"); + fileSystemMapping.addNonConfigurableFileMapping("file:///Source/devtools", "http://localhost:1234/front_end", "/wrong"); InspectorTest.addResult(fileSystemMapping.fileForURL("http://localhost:1234/front_end/file.txt").fileURL); next(); diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html b/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html index 45f4ac5..4db0472 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-mapping.html @@ -5,9 +5,9 @@ function test() { var paths = { - FOO: "/home/username/projects/foo", - BAR: "/home/username/projects/bar", - SITE1: "/www/site1" + FOO: "file:///home/username/projects/foo", + BAR: "file:///home/username/projects/bar", + SITE1: "file:///www/site1" }; function addFileSystem(fileSystemMapping, path) @@ -101,7 +101,7 @@ function test() addFileMapping(fileSystemMapping, paths.SITE1, "http://localhost/", "/"); addFileMapping(fileSystemMapping, paths.SITE1, "http://www.foo.com/", "/foo/"); addFileMapping(fileSystemMapping, paths.FOO, "http://www.example.com/bar/", "/foo/"); - addMappingForResource(fileSystemMapping, "http://www.bar.com/foo/folder/42.js", paths.FOO, "file://" + paths.FOO + "/baz/folder/42.js"); + addMappingForResource(fileSystemMapping, "http://www.bar.com/foo/folder/42.js", paths.FOO, paths.FOO + "/baz/folder/42.js"); InspectorTest.addResult("Testing mappings for url:"); dumpFileForURL(fileSystemMapping, "http://www.bar.com/foo/folder/42.js"); @@ -113,15 +113,15 @@ function test() InspectorTest.addResult(""); InspectorTest.addResult("Testing mappings for path:"); - dumpURLForPath(fileSystemMapping, paths.FOO, "file://" + paths.FOO + "/baz/folder/42.js"); - dumpURLForPath(fileSystemMapping, paths.FOO, "file://" + paths.FOO + "/baz/folder/43.js"); - dumpURLForPath(fileSystemMapping, paths.FOO, "file://" + paths.FOO + "/bar/folder/42.js"); - dumpURLForPath(fileSystemMapping, paths.FOO, "file://" + paths.FOO + "/foo/folder/42.js"); - dumpURLForPath(fileSystemMapping, paths.FOO, "file://" + paths.FOO + "/foo2/folder/42.js"); - dumpURLForPath(fileSystemMapping, paths.SITE1, "file://" + paths.SITE1 + "/foo/index.html"); - dumpURLForPath(fileSystemMapping, paths.SITE1, "file://" + paths.SITE1 + "/index.html"); - dumpURLForPath(fileSystemMapping, paths.SITE1, "file://" + paths.SITE1 + "/foo"); - dumpURLForPath(fileSystemMapping, paths.SITE1, "file://" + paths.SITE1 + "/foo/"); + dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/baz/folder/42.js"); + dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/baz/folder/43.js"); + dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/bar/folder/42.js"); + dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/foo/folder/42.js"); + dumpURLForPath(fileSystemMapping, paths.FOO, paths.FOO + "/foo2/folder/42.js"); + dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/index.html"); + dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/index.html"); + dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo"); + dumpURLForPath(fileSystemMapping, paths.SITE1, paths.SITE1 + "/foo/"); InspectorTest.addResult(""); // Then create another file mapping to make sure it is correctly restored from the settings. diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-project-expected.txt b/third_party/WebKit/LayoutTests/inspector/file-system-project-expected.txt index 0668bbc..7db184a9 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-project-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/file-system-project-expected.txt @@ -64,6 +64,6 @@ Running: testExcludesViaProject -- Excluded /html2/ via .devtools -- Dumping uiSourceCodes origin URLs: - - file:///html/foo.js - - file:///bar.js + - file:///var/www3/html/foo.js + - file:///var/www3/bar.js diff --git a/third_party/WebKit/LayoutTests/inspector/file-system-project.html b/third_party/WebKit/LayoutTests/inspector/file-system-project.html index faa07a7..d468b9e 100644 --- a/third_party/WebKit/LayoutTests/inspector/file-system-project.html +++ b/third_party/WebKit/LayoutTests/inspector/file-system-project.html @@ -55,8 +55,8 @@ function test() function testFileSystems(next) { InspectorTest.addResult("Adding first file system."); - var fs1 = new InspectorTest.TestFileSystem("/var/www"); - var fs2 = new InspectorTest.TestFileSystem("/foo/bar"); + var fs1 = new InspectorTest.TestFileSystem("file:///var/www"); + var fs2 = new InspectorTest.TestFileSystem("file:///foo/bar"); InspectorTest.addResult("Adding second file system."); var uiSourceCodes; @@ -67,8 +67,8 @@ function test() function fileSystemCreated() { InspectorTest.addResult("Adding file mappings."); - WebInspector.fileSystemMapping.addFileMapping("/var/www", "http://localhost/", "/localhost/"); - WebInspector.fileSystemMapping.addFileMapping("/foo/bar", "http://www.example.com/", "/"); + WebInspector.fileSystemMapping.addFileMapping("file:///var/www", "http://localhost/", "/localhost/"); + WebInspector.fileSystemMapping.addFileMapping("file:///foo/bar", "http://www.example.com/", "/"); InspectorTest.addResult("Adding files to file systems."); @@ -124,7 +124,7 @@ function test() function testDefaultExcludes(next) { - createFileSystem("/var/www", dumpExcludes); + createFileSystem("file:///var/www", dumpExcludes); function dumpExcludes(fs) { @@ -138,8 +138,8 @@ function test() function testExcludesSettings(next) { - WebInspector.settings.createLocalSetting("workspaceExcludedFolders", {}).set({"/var/www2":["/html/"]}); - createFileSystem("/var/www2", dumpExcludes); + WebInspector.settings.createLocalSetting("workspaceExcludedFolders", {}).set({"file:///var/www2":["/html/"]}); + createFileSystem("file:///var/www2", dumpExcludes); function dumpExcludes(fs) { @@ -153,7 +153,7 @@ function test() function testExcludesViaDelegate(next) { - createFileSystem("/var/www3", dumpExcludes); + createFileSystem("file:///var/www3", dumpExcludes); function dumpExcludes(fs) { @@ -168,7 +168,7 @@ function test() function testExcludesViaProject(next) { - var fs = new InspectorTest.TestFileSystem(name); + var fs = new InspectorTest.TestFileSystem("file:///var/www3"); fs.root.addFile(".devtools", JSON.stringify({excludes:["/html2/"]})); fs.root.mkdir("html").addFile("foo.js", ""); fs.root.mkdir(".git").addFile("foogit.js", ""); diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html index 50172ea..84a47f0 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/file-system-project-live-edit.html @@ -18,7 +18,7 @@ function test() InspectorTest.runTestSuite([ function testLiveEditReload(next) { - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.mkdir("html").addFile("edit-me.js", "function f()\n{\n return 0;\n}\n"); fs.root.addFile("bar.js", "<bar content>"); InspectorTest.addResult("Adding file system."); 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 e73f62b..5ce6623 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 @@ -11,7 +11,7 @@ function test() var target; var resourceScriptMapping; var defaultScriptMapping; - var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.projectId("/var/www"); + var fileSystemProjectId = WebInspector.FileSystemWorkspaceBinding.projectId("file:///var/www"); WebInspector.networkMapping.dispose(); function createWorkspaceWithTarget() @@ -43,7 +43,7 @@ function test() createWorkspaceWithTarget(); InspectorTest.addResult("Adding file system."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.mkdir("html").addFile("foo.js", "<foo content>"); fs.root.addFile("bar.js", "<bar content>"); fs.reportCreated(fileSystemCreated1); @@ -128,7 +128,7 @@ function test() WebInspector.targetManager = InspectorTest.testTargetManager; InspectorTest.addResult("Adding file system."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.mkdir("html").addFile("foo.js", originalFileContent); fs.root.addFile("bar.js", "<bar content>"); InspectorTest.addResult("Adding file system mapping."); @@ -245,7 +245,7 @@ function test() createWorkspaceWithTarget(); InspectorTest.addResult("Adding file system."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.addFile("foo.js", ""); fs.reportCreated(fileSystemCreated); @@ -275,7 +275,7 @@ function test() createWorkspaceWithTarget(); InspectorTest.addResult("Adding file system."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.mkdir("html").addFile("foo.js", "<foo content>"); fs.root.addFile("bar.js", "<bar content>"); fs.root.mkdir("foo").mkdir("bar").addFile("baz.js", "<baz content>"); @@ -319,7 +319,7 @@ function test() InspectorTest.testTargetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged, suspendStateChanged); InspectorTest.addResult("Adding file system."); - var fs = new InspectorTest.TestFileSystem("/var/www"); + var fs = new InspectorTest.TestFileSystem("file:///var/www"); fs.root.mkdir("html").addFile("foo.js", "<foo content>"); fs.root.mkdir("html2").addFile("bar.js", "<bar content>"); fs.root.addFile(".devtools", JSON.stringify({ mappings: [ { folder: "/html/", url: "http://localhost/h1/" }, { folder: "/html2/", url: "http://localhost/h2/" } ]})); diff --git a/third_party/WebKit/LayoutTests/inspector/workspace-mapping-expected.txt b/third_party/WebKit/LayoutTests/inspector/workspace-mapping-expected.txt index bce9be8..3616fb7 100644 --- a/third_party/WebKit/LayoutTests/inspector/workspace-mapping-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/workspace-mapping-expected.txt @@ -10,9 +10,9 @@ Tests workspace mappings url http://localhost/foo/index.html is mapped to null url https://localhost/index.html is mapped to null - path /home/example.com / foo/index.html is mapped to null - path /home/example.com / index.html is mapped to null - path /var/www / localhost/index.html is mapped to http://localhost/index.html - path /var/www / localhost/foo/index.html is mapped to http://localhost/foo/index.html - path /home/foo / index.html is mapped to null + path file:///home/example.com / foo/index.html is mapped to null + path file:///home/example.com / index.html is mapped to null + path file:///var/www / localhost/index.html is mapped to http://localhost/index.html + path file:///var/www / localhost/foo/index.html is mapped to http://localhost/foo/index.html + path file:///home/foo / index.html is mapped to null diff --git a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html index 9897cbb..751a661 100644 --- a/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/workspace-mapping.html @@ -24,10 +24,10 @@ function test() } var fileSystemMapping = new WebInspector.FileSystemMapping(); - var fileSystemPath = "/var/www"; + var fileSystemPath = "file:///var/www"; var projectId = WebInspector.FileSystemWorkspaceBinding.projectId(fileSystemPath); - fileSystemMapping.addFileSystem("/var/www"); - fileSystemMapping.addFileMapping("/var/www", "http://localhost/", "/localhost/"); + fileSystemMapping.addFileSystem("file:///var/www"); + fileSystemMapping.addFileMapping("file:///var/www", "http://localhost/", "/localhost/"); var fileSystemWorkspaceBinding = new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager, workspace); var networkMapping = new WebInspector.NetworkMapping(WebInspector.targetManager, workspace, fileSystemWorkspaceBinding, fileSystemMapping); @@ -48,7 +48,7 @@ function test() function dumpURLForPath(fileSystemPath, filePath) { - var url = networkMapping._urlForPath(fileSystemPath, "file://" + fileSystemPath + "/" + filePath) + var url = networkMapping._urlForPath(fileSystemPath, fileSystemPath + "/" + filePath) InspectorTest.addResult(" path " + fileSystemPath + " / " + filePath + " is mapped to " + (url ? url : null)); } @@ -71,11 +71,11 @@ function test() dumpUISourceCodeForURL("https://localhost/index.html"); InspectorTest.addResult(""); - dumpURLForPath("/home/example.com", "foo/index.html"); - dumpURLForPath("/home/example.com", "index.html"); - dumpURLForPath("/var/www", "localhost/index.html"); - dumpURLForPath("/var/www", "localhost/foo/index.html"); - dumpURLForPath("/home/foo", "index.html"); + dumpURLForPath("file:///home/example.com", "foo/index.html"); + dumpURLForPath("file:///home/example.com", "index.html"); + dumpURLForPath("file:///var/www", "localhost/index.html"); + dumpURLForPath("file:///var/www", "localhost/foo/index.html"); + dumpURLForPath("file:///home/foo", "index.html"); InspectorTest.completeTest(); } diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js index ff7fb06..62b1150 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js @@ -68,7 +68,7 @@ WebInspector.FileSystemWorkspaceBinding._lastRequestId = 0; */ WebInspector.FileSystemWorkspaceBinding.projectId = function(fileSystemPath) { - return "file://" + fileSystemPath; + return fileSystemPath; } /** @@ -125,7 +125,7 @@ WebInspector.FileSystemWorkspaceBinding.prototype = { { var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); var boundFileSystem = new WebInspector.FileSystemWorkspaceBinding.FileSystem(this, fileSystem, this._workspace); - this._boundFileSystems.set(fileSystem.normalizedPath(), boundFileSystem); + this._boundFileSystems.set(fileSystem.path(), boundFileSystem); }, /** @@ -134,9 +134,9 @@ WebInspector.FileSystemWorkspaceBinding.prototype = { _fileSystemRemoved: function(event) { var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data); - var boundFileSystem = this._boundFileSystems.get(fileSystem.normalizedPath()); + var boundFileSystem = this._boundFileSystems.get(fileSystem.path()); boundFileSystem.dispose(); - this._boundFileSystems.remove(fileSystem.normalizedPath()); + this._boundFileSystems.remove(fileSystem.path()); }, /** @@ -161,7 +161,7 @@ WebInspector.FileSystemWorkspaceBinding.prototype = { */ fileSystemPath: function(projectId) { - return projectId.substr("file://".length); + return projectId; }, /** @@ -265,7 +265,7 @@ WebInspector.FileSystemWorkspaceBinding.prototype = { InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.SearchCompleted, this._onSearchCompleted, this); for (var fileSystem of this._boundFileSystems.values()) { fileSystem.dispose(); - this._boundFileSystems.remove(fileSystem._fileSystem.normalizedPath()); + this._boundFileSystems.remove(fileSystem._fileSystem.path()); } } } @@ -282,15 +282,13 @@ WebInspector.FileSystemWorkspaceBinding.FileSystem = function(fileSystemWorkspac { this._fileSystemWorkspaceBinding = fileSystemWorkspaceBinding; this._fileSystem = isolatedFileSystem; - this._fileSystemBaseURL = "file://" + this._fileSystem.normalizedPath() + "/"; + this._fileSystemBaseURL = this._fileSystem.path() + "/"; this._fileSystemPath = this._fileSystem.path(); var id = WebInspector.FileSystemWorkspaceBinding.projectId(this._fileSystemPath); console.assert(!workspace.project(id)); - var normalizedPath = isolatedFileSystem.normalizedPath(); - var displayName = normalizedPath.substr(normalizedPath.lastIndexOf("/") + 1); - + var displayName = this._fileSystemPath.substr(this._fileSystemPath.lastIndexOf("/") + 1); WebInspector.ProjectStore.call(this, workspace, id, WebInspector.projectTypes.FileSystem, displayName); workspace.addProject(this); @@ -312,7 +310,7 @@ WebInspector.FileSystemWorkspaceBinding.FileSystem.prototype = { */ _filePathForUISourceCode: function(uiSourceCode) { - return uiSourceCode.path().substring(("file:// " + this._fileSystemPath).length); + return uiSourceCode.path().substring(this._fileSystemPath.length); }, /** diff --git a/third_party/WebKit/Source/devtools/front_end/common/Settings.js b/third_party/WebKit/Source/devtools/front_end/common/Settings.js index cfa0b15..6944a29 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Settings.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Settings.js @@ -399,7 +399,7 @@ WebInspector.VersionController = function() } WebInspector.VersionController._currentVersionName = "inspectorVersion"; -WebInspector.VersionController.currentVersion = 17; +WebInspector.VersionController.currentVersion = 18; WebInspector.VersionController.prototype = { updateVersion: function() @@ -682,6 +682,24 @@ WebInspector.VersionController.prototype = { setting.set(newValue); }, + _updateVersionFrom17To18: function() + { + var setting = WebInspector.settings.createLocalSetting("workspaceExcludedFolders", {}); + var oldValue = setting.get(); + var newValue = {}; + for (var oldKey in oldValue) { + var newKey = oldKey.replace(/\\/g, "/"); + if (!newKey.startsWith("file://")) { + if (newKey.startsWith("/")) + newKey = "file://" + newKey; + else + newKey = "file:///" + newKey; + } + newValue[newKey] = oldValue[oldKey]; + } + setting.set(newValue); + }, + _migrateSettingsFromLocalStorage: function() { // This step migrates all the settings except for the ones below into the browser profile. diff --git a/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js b/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js index 627629a..d1be627 100644 --- a/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js +++ b/third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js @@ -230,7 +230,7 @@ WebInspector.EditFileSystemView.prototype = { titles.createChild("div", "file-system-value").textContent = WebInspector.UIString("Folder path"); var fields = content.createChild("div", "file-system-edit-row"); - fields.createChild("div", "file-system-value").appendChild(editor.createInput("urlPrefix", "text", "localhost:8000/url", urlPrefixValidator.bind(this))); + fields.createChild("div", "file-system-value").appendChild(editor.createInput("urlPrefix", "text", "http://localhost:8000/url", urlPrefixValidator.bind(this))); fields.createChild("div", "file-system-separator file-system-separator-invisible"); fields.createChild("div", "file-system-value").appendChild(editor.createInput("pathPrefix", "text", "/path/to/folder/", pathPrefixValidator.bind(this))); 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 20935a2..83c8b03 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js @@ -53,12 +53,13 @@ WebInspector.FileSystemMapping.prototype = { this._fileSystemMappings = {}; for (var fileSystemPath in savedMapping) { var savedFileSystemMappings = savedMapping[fileSystemPath]; + fileSystemPath = WebInspector.IsolatedFileSystem.normalizePath(fileSystemPath); this._fileSystemMappings[fileSystemPath] = []; var fileSystemMappings = this._fileSystemMappings[fileSystemPath]; for (var i = 0; i < savedFileSystemMappings.length; ++i) { var savedEntry = savedFileSystemMappings[i]; - var entry = new WebInspector.FileSystemMapping.Entry(savedEntry.fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true); + var entry = new WebInspector.FileSystemMapping.Entry(fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true); fileSystemMappings.push(entry); } } @@ -264,7 +265,7 @@ WebInspector.FileSystemMapping.prototype = { return null; var file = {}; file.fileSystemPath = entry.fileSystemPath; - file.fileURL = "file://" + entry.fileSystemPath + entry.pathPrefix + url.substr(entry.urlPrefix.length); + file.fileURL = entry.fileSystemPath + entry.pathPrefix + url.substr(entry.urlPrefix.length); return file; }, @@ -275,7 +276,7 @@ WebInspector.FileSystemMapping.prototype = { */ urlForPath: function(fileSystemPath, filePath) { - var relativePath = filePath.substring("file://".length + fileSystemPath.length); + var relativePath = filePath.substring(fileSystemPath.length); var entry = this._mappingEntryForPath(fileSystemPath, relativePath); if (!entry) return ""; @@ -310,7 +311,7 @@ WebInspector.FileSystemMapping.prototype = { if (filePathCharacter === "/") commonPathSuffixLength = i; } - var pathPrefix = filePath.substring("file://".length + fileSystemPath.length, filePath.length - commonPathSuffixLength); + var pathPrefix = filePath.substring(fileSystemPath.length, filePath.length - commonPathSuffixLength); var urlPrefix = url.substr(0, url.length - commonPathSuffixLength); this.addFileMapping(fileSystemPath, urlPrefix, pathPrefix); }, diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js index 3e458d0..70bb761 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystem.js @@ -107,8 +107,13 @@ WebInspector.IsolatedFileSystem.errorMessage = function(error) */ WebInspector.IsolatedFileSystem.normalizePath = function(fileSystemPath) { - if (WebInspector.isWin()) - return fileSystemPath.replace(/\\/g, "/"); + fileSystemPath = fileSystemPath.replace(/\\/g, "/"); + if (!fileSystemPath.startsWith("file://")) { + if (fileSystemPath.startsWith("/")) + fileSystemPath = "file://" + fileSystemPath; + else + fileSystemPath = "file:///" + fileSystemPath; + } return fileSystemPath; } @@ -122,17 +127,6 @@ WebInspector.IsolatedFileSystem.prototype = { }, /** - * @return {string} - */ - normalizedPath: function() - { - if (this._normalizedPath) - return this._normalizedPath; - this._normalizedPath = WebInspector.IsolatedFileSystem.normalizePath(this._path); - return this._normalizedPath; - }, - - /** * @param {?Object} projectObject */ _initializeProject: function(projectObject) diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js index 5869e61..333db74 100644 --- a/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js +++ b/third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js @@ -119,7 +119,7 @@ WebInspector.IsolatedFileSystemManager.prototype = { */ _innerAddFileSystem: function(fileSystem) { - var fileSystemPath = fileSystem.fileSystemPath; + var fileSystemPath = WebInspector.IsolatedFileSystem.normalizePath(fileSystem.fileSystemPath); var promise = WebInspector.IsolatedFileSystem.create(this, fileSystemPath, fileSystem.fileSystemName, fileSystem.rootURL); return promise.then(storeFileSystem.bind(this)); |