| 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 dumpAsText: function() { |
| 18 var result = []; |
| 19 dfs(this.root, ''); |
| 20 result[0] = this.fileSystemPath; |
| 21 return result.join('\n'); |
| 22 |
| 23 function dfs(node, indent) { |
| 24 result.push(indent + node.name); |
| 25 var newIndent = indent + ' '; |
| 26 for (var child of node._children) |
| 27 dfs(child, newIndent); |
| 28 } |
| 29 }, |
| 30 |
| 17 reportCreated: function(callback) | 31 reportCreated: function(callback) |
| 18 { | 32 { |
| 19 var fileSystemPath = this.fileSystemPath; | 33 var fileSystemPath = this.fileSystemPath; |
| 20 InspectorTest.TestFileSystem._instances[this.fileSystemPath] = this; | 34 InspectorTest.TestFileSystem._instances[this.fileSystemPath] = this; |
| 21 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemAdded, { | 35 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemAdded, { |
| 22 fileSystem: { fileSystemPath: this.fileSystemPath, | 36 fileSystem: { fileSystemPath: this.fileSystemPath, |
| 23 fileSystemName: this.fileSystemPath } | 37 fileSystemName: this.fileSystemPath } |
| 24 }); | 38 }); |
| 25 | 39 |
| 26 Workspace.isolatedFileSystemManager.addEventListener(Workspace.IsolatedF
ileSystemManager.Events.FileSystemAdded, created); | 40 Workspace.isolatedFileSystemManager.addEventListener(Workspace.IsolatedF
ileSystemManager.Events.FileSystemAdded, created); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 truncate: function(num) | 254 truncate: function(num) |
| 241 { | 255 { |
| 242 this._entry._timestamp += this._modificationTimesDelta; | 256 this._entry._timestamp += this._modificationTimesDelta; |
| 243 this._entry.content = this._entry.content.slice(0, num); | 257 this._entry.content = this._entry.content.slice(0, num); |
| 244 if (this.onwriteend) | 258 if (this.onwriteend) |
| 245 this.onwriteend(); | 259 this.onwriteend(); |
| 246 } | 260 } |
| 247 } | 261 } |
| 248 | 262 |
| 249 }; | 263 }; |
| OLD | NEW |