Changeset 120430 in webkit
- Timestamp:
- Jun 15, 2012, 2:33:12 AM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
http/tests/inspector/filesystem/filesystem-test.js (modified) (2 diffs)
-
http/tests/inspector/filesystem/read-directory.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120429 r120430 1 2012-06-15 Taiju Tsuiki <tzik@chromium.org> 2 3 Web Inspector: LayoutTest http/tests/inspector/filesystem/* should clean up FileSystem after test. 4 https://bugs.webkit.org/show_bug.cgi?id=89066 5 6 Reviewed by Vsevolod Vlasov. 7 8 * http/tests/inspector/filesystem/filesystem-test.js: 9 (initialize_FileSystemTest.InspectorTest.clearFileSystem): 10 (dispatchCallback): 11 (createDirectory.gotFileSystem): 12 (createDirectory): 13 (createFile.gotFileSystem): 14 (clearFileSystem.gotRoot): 15 (clearFileSystem.gotRoot.removeAll): 16 (clearFileSystem.onError): 17 * http/tests/inspector/filesystem/read-directory.html: 18 1 19 2012-06-15 Kent Tamura <tkent@chromium.org> 2 20 -
trunk/LayoutTests/http/tests/inspector/filesystem/filesystem-test.js
r120177 r120430 30 30 }; 31 31 32 InspectorTest.clearFileSystem = function(callback) 33 { 34 InspectorTest.evaluateInPage("clearFileSystem(" + InspectorTest.registerCallback(callback) + ")"); 35 }; 36 32 37 InspectorTest.dumpReadDirectoryResult = function(requestId, errorCode, entries) 33 38 { … … 52 57 { 53 58 var args = JSON.stringify(Array.prototype.slice.call(arguments)); 54 layoutTestController.evaluateInWebInspector(0, "InspectorTest.dispatchCallback(unescape(\"" + escape(args) + "\"))");59 testRunner.evaluateInWebInspector(999, "InspectorTest.dispatchCallback(unescape(\"" + escape(args) + "\"))"); 55 60 } 56 61 57 62 function createDirectory(path, callback) 58 63 { 59 webkitRequestFileSystem(TEMPORARY, 1, function(fs) { 60 fs.root.getDirectory(path, {create:true}, function(entry) { 64 webkitRequestFileSystem(TEMPORARY, 1, gotFileSystem); 65 66 function gotFileSystem(fileSystem) 67 { 68 fileSystem.root.getDirectory(path, {create:true}, function(entry) { 61 69 callback(); 62 70 }); 63 } );71 } 64 72 } 65 73 66 74 function createFile(path, callback) 67 75 { 68 webkitRequestFileSystem(TEMPORARY, 1, function(fs) { 69 fs.root.getFile(path, {create:true}, function(entry) { 76 webkitRequestFileSystem(TEMPORARY, 1, gotFileSystem); 77 78 function gotFileSystem(fileSystem) 79 { 80 fileSystem.root.getFile(path, {create:true}, function(entry) { 70 81 callback(); 71 82 }); 72 } );83 } 73 84 } 85 86 function clearFileSystem(callback) 87 { 88 webkitResolveLocalFileSystemURL("filesystem:" + location.origin + "/temporary/", gotRoot, onError); 89 90 function gotRoot(root) 91 { 92 var reader = root.createReader(); 93 reader.readEntries(didReadEntries); 94 95 var entries = []; 96 function didReadEntries(newEntries) 97 { 98 if (newEntries.length === 0) { 99 removeAll(); 100 return; 101 } 102 for (var i = 0; i < newEntries.length; ++i) 103 entries.push(newEntries[i]); 104 reader.readEntries(didReadEntries); 105 } 106 107 function removeAll() 108 { 109 if (entries.length === 0) { 110 callback(); 111 return; 112 } 113 var entry = entries.shift(); 114 if (entry.isDirectory) 115 entry.removeRecursively(removeAll); 116 else 117 entry.remove(removeAll); 118 } 119 } 120 121 function onError() 122 { 123 // Assume the FileSystem is uninitialized and therefore empty. 124 callback(); 125 } 126 } -
trunk/LayoutTests/http/tests/inspector/filesystem/read-directory.html
r120177 r120430 17 17 FileSystemAgent.enable(); 18 18 19 step1();19 InspectorTest.clearFileSystem(step1); 20 20 21 21 function step1() … … 53 53 InspectorTest.dumpReadDirectoryResult(requestId, errorCode, entries); 54 54 55 InspectorTest.clearFileSystem(step7); 56 } 57 58 function step7() 59 { 55 60 InspectorTest.completeTest(); 56 61 }
Note:
See TracChangeset
for help on using the changeset viewer.