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

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

Issue 2697403003: DevTools: "Delete File" in navigator should actually delete a file (Closed)
Patch Set: address comments Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/persistence/filesystem-delete-file.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
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
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 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/persistence/filesystem-delete-file.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698