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); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 addFile: function(name, content) | 99 addFile: function(name, content) |
100 { | 100 { |
101 var child = new InspectorTest.TestFileSystem.Entry(this._fileSystem, nam
e, false, this); | 101 var child = new InspectorTest.TestFileSystem.Entry(this._fileSystem, nam
e, false, this); |
102 this._childrenMap[name] = child; | 102 this._childrenMap[name] = child; |
103 this._children.push(child); | 103 this._children.push(child); |
104 child.parent = this; | 104 child.parent = this; |
105 child.content = new Blob([content], {type: 'text/plain'}); | 105 child.content = new Blob([content], {type: 'text/plain'}); |
106 return child; | 106 return child; |
107 }, | 107 }, |
108 | 108 |
| 109 setContent: function(content) |
| 110 { |
| 111 this.content = new Blob([content], {type: 'text/plain'}); |
| 112 var fullPath = this._fileSystem.fileSystemPath + this.fullPath; |
| 113 InspectorFrontendHost.events.dispatchEventToListeners(InspectorFrontendH
ostAPI.Events.FileSystemFilesChanged, [fullPath]); |
| 114 }, |
| 115 |
109 createReader: function() | 116 createReader: function() |
110 { | 117 { |
111 return new InspectorTest.TestFileSystem.Reader(this._children); | 118 return new InspectorTest.TestFileSystem.Reader(this._children); |
112 }, | 119 }, |
113 | 120 |
114 createWriter: function(success, failure) | 121 createWriter: function(success, failure) |
115 { | 122 { |
116 success(new InspectorTest.TestFileSystem.Writer(this)); | 123 success(new InspectorTest.TestFileSystem.Writer(this)); |
117 }, | 124 }, |
118 | 125 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 truncate: function(num) | 207 truncate: function(num) |
201 { | 208 { |
202 this._entry._timestamp += this._modificationTimesDelta; | 209 this._entry._timestamp += this._modificationTimesDelta; |
203 this._entry.content = this._entry.content.slice(0, num); | 210 this._entry.content = this._entry.content.slice(0, num); |
204 if (this.onwriteend) | 211 if (this.onwriteend) |
205 this.onwriteend(); | 212 this.onwriteend(); |
206 } | 213 } |
207 } | 214 } |
208 | 215 |
209 }; | 216 }; |
OLD | NEW |