| OLD | NEW |
| 1 var initialize_IsolatedFileSystemTest = function() { | 1 var initialize_IsolatedFileSystemTest = function() { |
| 2 | 2 |
| 3 InspectorFrontendHost.isolatedFileSystem = function(name) | 3 InspectorFrontendHost.isolatedFileSystem = function(name) |
| 4 { | 4 { |
| 5 return InspectorTest.TestFileSystem._instances[name]; | 5 return InspectorTest.TestFileSystem._instances[name]; |
| 6 } | 6 } |
| 7 | 7 |
| 8 InspectorTest.TestFileSystem = function(fileSystemPath) | 8 InspectorTest.TestFileSystem = function(fileSystemPath) |
| 9 { | 9 { |
| 10 this.root = new InspectorTest.TestFileSystem.Entry(this, "", true, null); | 10 this.root = new InspectorTest.TestFileSystem.Entry(this, "", true, null); |
| 11 this.fileSystemPath = fileSystemPath; | 11 this.fileSystemPath = fileSystemPath; |
| 12 } | 12 } |
| 13 | 13 |
| 14 InspectorTest.TestFileSystem._instances = {}; | 14 InspectorTest.TestFileSystem._instances = {}; |
| 15 | 15 |
| 16 InspectorTest.TestFileSystem.prototype = { | 16 InspectorTest.TestFileSystem.prototype = { |
| 17 reportCreated: function(callback) | 17 reportCreated: function(callback) |
| 18 { | 18 { |
| 19 var fileSystemPath = this.fileSystemPath; | 19 var fileSystemPath = this.fileSystemPath; |
| 20 InspectorTest.TestFileSystem._instances[this.fileSystemPath] = this; | 20 InspectorTest.TestFileSystem._instances[this.fileSystemPath] = this; |
| 21 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemAdded, { | 21 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemAdded, { |
| 22 fileSystem: { fileSystemPath: this.fileSystemPath, | 22 fileSystem: { fileSystemPath: this.fileSystemPath, |
| 23 fileSystemName: this.fileSystemPath } | 23 fileSystemName: this.fileSystemPath } |
| 24 }); | 24 }); |
| 25 | 25 |
| 26 WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.Iso
latedFileSystemManager.Events.FileSystemAdded, created); | 26 Workspace.isolatedFileSystemManager.addEventListener(Workspace.IsolatedF
ileSystemManager.Events.FileSystemAdded, created); |
| 27 | 27 |
| 28 function created(event) | 28 function created(event) |
| 29 { | 29 { |
| 30 var fileSystem = event.data; | 30 var fileSystem = event.data; |
| 31 if (fileSystem.path() !== fileSystemPath) | 31 if (fileSystem.path() !== fileSystemPath) |
| 32 return; | 32 return; |
| 33 WebInspector.isolatedFileSystemManager.removeEventListener(WebInspec
tor.IsolatedFileSystemManager.Events.FileSystemAdded, created); | 33 Workspace.isolatedFileSystemManager.removeEventListener(Workspace.Is
olatedFileSystemManager.Events.FileSystemAdded, created); |
| 34 callback(fileSystem); | 34 callback(fileSystem); |
| 35 } | 35 } |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 reportRemoved: function() | 38 reportRemoved: function() |
| 39 { | 39 { |
| 40 delete InspectorTest.TestFileSystem._instances[this.fileSystemPath]; | 40 delete InspectorTest.TestFileSystem._instances[this.fileSystemPath]; |
| 41 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemRemoved, this.fileSystemPath); | 41 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemRemoved, this.fileSystemPath); |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 addFileMapping: function(urlPrefix, pathPrefix) | 44 addFileMapping: function(urlPrefix, pathPrefix) |
| 45 { | 45 { |
| 46 var fileSystemMapping = new WebInspector.FileSystemMapping(); | 46 var fileSystemMapping = new Workspace.FileSystemMapping(); |
| 47 fileSystemMapping.addFileSystem(this.fileSystemPath); | 47 fileSystemMapping.addFileSystem(this.fileSystemPath); |
| 48 fileSystemMapping.addFileMapping(this.fileSystemPath, urlPrefix, pathPre
fix); | 48 fileSystemMapping.addFileMapping(this.fileSystemPath, urlPrefix, pathPre
fix); |
| 49 WebInspector.fileSystemMapping._loadFromSettings(); | 49 Workspace.fileSystemMapping._loadFromSettings(); |
| 50 }, | 50 }, |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * @param {string} path | 53 * @param {string} path |
| 54 * @param {string} content | 54 * @param {string} content |
| 55 * @param {number} lastModified | 55 * @param {number} lastModified |
| 56 */ | 56 */ |
| 57 addFile: function(path, content, lastModified) | 57 addFile: function(path, content, lastModified) |
| 58 { | 58 { |
| 59 var pathTokens = path.split("/"); | 59 var pathTokens = path.split("/"); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 truncate: function(num) | 233 truncate: function(num) |
| 234 { | 234 { |
| 235 this._entry._timestamp += this._modificationTimesDelta; | 235 this._entry._timestamp += this._modificationTimesDelta; |
| 236 this._entry.content = this._entry.content.slice(0, num); | 236 this._entry.content = this._entry.content.slice(0, num); |
| 237 if (this.onwriteend) | 237 if (this.onwriteend) |
| 238 this.onwriteend(); | 238 this.onwriteend(); |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 }; | 242 }; |
| OLD | NEW |