Changeset 145536 in webkit
- Timestamp:
- Mar 12, 2013 5:42:14 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r145533 r145536 1 2013-03-12 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Add a test for Workspace add/removeMapping methods. 4 https://bugs.webkit.org/show_bug.cgi?id=112035 5 6 Reviewed by Alexander Pavlov. 7 8 * http/tests/inspector/isolated-filesystem-test.js: Added. 9 (initialize_IsolatedFileSystemTest.InspectorTest.createIsolatedFileSystemManager): 10 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystem): 11 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystem.prototype.path): 12 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystem.prototype.requestFileContent): 13 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystem.prototype.setFileContent): 14 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystem.prototype.requestFilesRecursive): 15 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystemManager): 16 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystemManager.prototype.addMockFileSystem): 17 (initialize_IsolatedFileSystemTest.MockIsolatedFileSystemManager.prototype.removeMockFileSystem): 18 (initialize_IsolatedFileSystemTest): 19 * inspector/debugger/file-system-project-mapping-expected.txt: Added. 20 * inspector/debugger/file-system-project-mapping.html: Added. 21 * inspector/debugger/resource-script-mapping.html: 22 * inspector/file-system-project.html: 23 1 24 2013-03-12 Vsevolod Vlasov <vsevik@chromium.org> 2 25 -
trunk/LayoutTests/inspector/debugger/resource-script-mapping.html
r139454 r145536 7 7 function test() 8 8 { 9 var workspace;10 9 var defaultScriptMapping; 11 10 function createResourceScriptMapping() -
trunk/LayoutTests/inspector/file-system-project.html
r144729 r145536 4 4 <script src="../http/tests/inspector/debugger-test.js"></script> 5 5 <script src="../http/tests/inspector/workspace-test.js"></script> 6 <script src="../http/tests/inspector/isolated-filesystem-test.js"></script> 6 7 <script> 7 8 function test() 8 9 { 9 var MockIsolatedFileSystem = function(id, path, files)10 {11 this._id = id;12 this._path = path;13 this._files = files;14 };15 MockIsolatedFileSystem.prototype = {16 id: function()17 {18 return this._id;19 },20 21 path: function()22 {23 return this._path;24 },25 26 requestFileContent: function(path, callback)27 {28 callback(this._files[path]);29 },30 31 setFileContent: function(path, newContent, callback)32 {33 this._files[path] = newContent;34 callback();35 },36 37 requestFilesRecursive: function(path, callback)38 {39 var files = Object.keys(this._files);40 for (var i = 0; i < files.length; ++i)41 callback(files[i]);42 },43 }44 45 var MockIsolatedFileSystemManager = function() {};46 MockIsolatedFileSystemManager.prototype = {47 addMockFileSystem: function(path, files)48 {49 var id = InspectorTest.testFileSystemMapping.addFileSystemMapping(path);50 var fileSystem = new MockIsolatedFileSystem(id, path, files);51 this._fileSystems = this._fileSystems || {};52 this._fileSystems[path] = fileSystem;53 this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, fileSystem);54 },55 56 removeMockFileSystem: function(path)57 {58 var fileSystem = this._fileSystems[path];59 delete this._fileSystems[path];60 InspectorTest.testFileSystemMapping.removeFileSystemMapping(path);61 this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, fileSystem);62 },63 64 __proto__: WebInspector.Object.prototype65 }66 67 function createIsolatedFileSystemManager()68 {69 InspectorTest.createWorkspace();70 var manager = new MockIsolatedFileSystemManager();71 manager.fileSystemWorkspaceProvider = new WebInspector.FileSystemWorkspaceProvider(manager, InspectorTest.testWorkspace);72 return manager;73 }74 75 10 function dumpUISourceCodes(uiSourceCodes, next) 76 11 { … … 91 26 function testFileSystems(next) 92 27 { 28 InspectorTest.createWorkspace(); 29 var manager = InspectorTest.createIsolatedFileSystemManager(InspectorTest.testWorkspace, InspectorTest.testFileSystemMapping); 93 30 var uiSourceCodes = []; 94 var manager = createIsolatedFileSystemManager();95 31 var entry1 = new WebInspector.FileMapping.Entry("http://localhost/", "/var/www/localhost/"); 96 32 var entry2 = new WebInspector.FileMapping.Entry("http://www.example.com/", "/foo/bar/"); -
trunk/Source/WebCore/ChangeLog
r145533 r145536 1 2013-03-12 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Add a test for Workspace add/removeMapping methods. 4 https://bugs.webkit.org/show_bug.cgi?id=112035 5 6 Reviewed by Alexander Pavlov. 7 8 Test: inspector/debugger/file-system-project-mapping.html 9 10 * inspector/front-end/ScriptsPanel.js: 11 (WebInspector.ScriptsPanel.prototype._mapFileSystemToNetwork.mapFileSystemToNetwork): 12 (WebInspector.ScriptsPanel.prototype._mapFileSystemToNetwork): 13 (WebInspector.ScriptsPanel.prototype._mapNetworkToFileSystem.mapNetworkToFileSystem): 14 (WebInspector.ScriptsPanel.prototype._mapNetworkToFileSystem): 15 * inspector/front-end/Workspace.js: 16 (WebInspector.Project.prototype._fileAdded): 17 (WebInspector.Workspace.prototype.addMapping): 18 1 19 2013-03-12 Vsevolod Vlasov <vsevik@chromium.org> 2 20 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r145533 r145536 1124 1124 function mapFileSystemToNetwork(networkUISourceCode) 1125 1125 { 1126 this._workspace.addMapping(networkUISourceCode, uiSourceCode );1126 this._workspace.addMapping(networkUISourceCode, uiSourceCode, WebInspector.fileSystemWorkspaceProvider); 1127 1127 } 1128 1128 }, … … 1149 1149 function mapNetworkToFileSystem(uiSourceCode) 1150 1150 { 1151 this._workspace.addMapping(networkUISourceCode, uiSourceCode );1151 this._workspace.addMapping(networkUISourceCode, uiSourceCode, WebInspector.fileSystemWorkspaceProvider); 1152 1152 } 1153 1153 }, -
trunk/Source/WebCore/inspector/front-end/Workspace.js
r145221 r145536 187 187 return; 188 188 } 189 189 190 uiSourceCode = new WebInspector.UISourceCode(this, fileDescriptor.path, fileDescriptor.originURL, fileDescriptor.url, fileDescriptor.contentType, fileDescriptor.isEditable); 190 191 uiSourceCode.isContentScript = fileDescriptor.isContentScript; … … 482 483 * @param {WebInspector.UISourceCode} networkUISourceCode 483 484 * @param {WebInspector.UISourceCode} uiSourceCode 484 */ 485 addMapping: function(networkUISourceCode, uiSourceCode) 485 * @param {WebInspector.FileSystemWorkspaceProvider} fileSystemWorkspaceProvider 486 */ 487 addMapping: function(networkUISourceCode, uiSourceCode, fileSystemWorkspaceProvider) 486 488 { 487 489 var url = networkUISourceCode.url; … … 494 496 suffix = nextSuffix; 495 497 } 496 var fileSystemPath = WebInspector.fileSystemWorkspaceProvider.fileSystemPath(uiSourceCode);498 var fileSystemPath = fileSystemWorkspaceProvider.fileSystemPath(uiSourceCode); 497 499 var filePath = "/" + path.join("/"); 498 500 var pathPrefix = fileSystemPath + filePath.substr(0, filePath.length - suffix.length) + "/";
Note: See TracChangeset
for help on using the changeset viewer.