Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/isolated-filesystem-test.js

Issue 2040563002: Remove FileError interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fe-dep
Patch Set: handleEvent -> invoke and other review nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 { 135 {
136 if (path.startsWith("/")) 136 if (path.startsWith("/"))
137 path = path.substring(1); 137 path = path.substring(1);
138 if (!path) { 138 if (!path) {
139 callback(this); 139 callback(this);
140 return; 140 return;
141 } 141 }
142 var entry = this; 142 var entry = this;
143 for (var token of path.split("/")) 143 for (var token of path.split("/"))
144 entry = entry._childrenMap[token]; 144 entry = entry._childrenMap[token];
145 entry ? callback(entry) : errorCallback({ code: FileError.NOT_FOUND_ERR} ); 145 entry ? callback(entry) : errorCallback(new DOMException('Path not found : ' + path, 'NotFoundError'));
146 }, 146 },
147 147
148 getMetadata: function(success, failure) 148 getMetadata: function(success, failure)
149 { 149 {
150 success({ 150 success({
151 modificationTime: new Date(this._timestamp), 151 modificationTime: new Date(this._timestamp),
152 size: this.isDirectory ? 0 : this.content.size 152 size: this.isDirectory ? 0 : this.content.size
153 }); 153 });
154 }, 154 },
155 155
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 truncate: function(num) 200 truncate: function(num)
201 { 201 {
202 this._entry._timestamp += this._modificationTimesDelta; 202 this._entry._timestamp += this._modificationTimesDelta;
203 this._entry.content = this._entry.content.slice(0, num); 203 this._entry.content = this._entry.content.slice(0, num);
204 if (this.onwriteend) 204 if (this.onwriteend)
205 this.onwriteend(); 205 this.onwriteend();
206 } 206 }
207 } 207 }
208 208
209 }; 209 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698