Skip to content

Commit

Permalink
Merge pull request adobe#1338 from adobe/glenn/brackets-shell-issue-52
Browse files Browse the repository at this point in the history
Fix NativeFileSystem unit tests.
  • Loading branch information
redmunds committed Aug 3, 2012
2 parents 1f33643 + 84991e7 commit 3ec6bcb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/spec/NativeFileSystem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,22 @@ define(function (require, exports, module) {
function requestNativeFileSystemSuccessCB(nfs) {
accessedFolder = true;

function recreatePlaceholder(successCallback) {
function recreatePlaceholder(deferred) {
nfs.getFile("placeholder",
{ create: true, exclusive: true },
function () { placeholderRecreated = true; },
function () { placeholderRecreated = false; });
function () { placeholderRecreated = true; deferred.resolve(); },
function () { placeholderRecreated = false; deferred.reject(); });
}

function readDirectory() {
var reader = nfs.createReader();
var successCallback = function (e) {
entries = e;
recreatePlaceholder();
deferred.resolve();
recreatePlaceholder(deferred);
};
var errorCallback = function () {
gotErrorReadingContents = true;
recreatePlaceholder();
deferred.reject();
recreatePlaceholder(deferred);
};
reader.readEntries(successCallback, errorCallback);
}
Expand Down

0 comments on commit 3ec6bcb

Please sign in to comment.