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

Side by Side Diff: LayoutTests/fast/filesystem/resources/op-tests-helper.js

Issue 22436002: Replace EntryArray type by an Entry[] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Helper routine. 1 // Helper routine.
2 function toString(obj) { 2 function toString(obj) {
3 if (obj == undefined) { 3 if (obj == undefined) {
4 return "undefined"; 4 return "undefined";
5 } else if (typeof obj == 'object') { 5 } else if (typeof obj == 'object') {
6 if (obj.length != undefined) { 6 if (obj.length != undefined) {
7 var stringArray = []; 7 var stringArray = [];
8 for (var i = 0; i < obj.length; ++i) 8 for (var i = 0; i < obj.length; ++i)
9 stringArray.push(toString(obj[i])); 9 stringArray.push(toString(obj[i]));
10 stringArray.sort(); 10 stringArray.sort();
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 this.runNextTest(); 200 this.runNextTest();
201 } else 201 } else
202 testFailed('Unexpectedly succeeded while ' + this.stage); 202 testFailed('Unexpectedly succeeded while ' + this.stage);
203 }; 203 };
204 204
205 this.testReadEntriesSuccessCallback = function(entries) 205 this.testReadEntriesSuccessCallback = function(entries)
206 { 206 {
207 if (this.expectedErrorCode) 207 if (this.expectedErrorCode)
208 testFailed('Unexpectedly succeeded while ' + this.stage); 208 testFailed('Unexpectedly succeeded while ' + this.stage);
209 209
210 for (var i = 0; i < entries.length; ++i) 210 this.readEntries.push.apply(this.readEntries, entries);
211 this.readEntries.push(entries[i]);
212 211
213 if (entries.length) { 212 if (entries.length) {
214 this.currentReader.readEntries(bindCallback(this, this.testReadE ntriesSuccessCallback), bindCallback(this, this.testErrorCallback)); 213 this.currentReader.readEntries(bindCallback(this, this.testReadE ntriesSuccessCallback), bindCallback(this, this.testErrorCallback));
215 return; 214 return;
216 } 215 }
217 216
218 testPassed('Succeeded: ' + this.stage); 217 testPassed('Succeeded: ' + this.stage);
219 debug('Entries: ' + toString(this.readEntries)); 218 debug('Entries: ' + toString(this.readEntries));
220 this.runNextTest(); 219 this.runNextTest();
221 }; 220 };
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 403 }
405 404
406 function fileSystemCallback(fs) 405 function fileSystemCallback(fs)
407 { 406 {
408 fileSystem = fs; 407 fileSystem = fs;
409 runNextTest(); 408 runNextTest();
410 } 409 }
411 410
412 var jsTestIsAsync = true; 411 var jsTestIsAsync = true;
413 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback); 412 webkitRequestFileSystem(TEMPORARY, 100, fileSystemCallback, errorCallback);
OLDNEW
« no previous file with comments | « LayoutTests/fast/filesystem/read-directory-expected.txt ('k') | LayoutTests/fast/filesystem/script-tests/read-directory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698