mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2024-10-16 06:12:06 +08:00
CB-8125: Fix spec tests 28 and 29
These tests had long been failing (silently). The refactor for CB-8125 surfaced those failures, and so this fixes them.
This commit is contained in:
parent
fc8f4f0001
commit
2bfbd2c782
@ -584,13 +584,20 @@ exports.defineAutoTests = function () {
|
|||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var internalFilePath;
|
||||||
|
if (root.toInternalURL) {
|
||||||
|
internalFilePath = root.toInternalURL() + fileName;
|
||||||
|
} else {
|
||||||
|
internalFilePath = localFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
// This is an undocumented interface to File which exists only for testing
|
// This is an undocumented interface to File which exists only for testing
|
||||||
// backwards compatibilty. By obtaining the raw filesystem path of the download
|
// backwards compatibilty. By obtaining the raw filesystem path of the download
|
||||||
// location, we can pass that to transfer.download() to make sure that previously-stored
|
// location, we can pass that to transfer.download() to make sure that previously-stored
|
||||||
// paths are still valid.
|
// paths are still valid.
|
||||||
cordova.exec(function (localPath) {
|
cordova.exec(function (localPath) {
|
||||||
transfer.download(fileURL, localPath, downloadWin, unexpectedCallbacks.httpFail);
|
transfer.download(fileURL, localPath, downloadWin, unexpectedCallbacks.httpFail);
|
||||||
}, unsupported, 'File', '_getLocalFilesystemPath', [localFilePath]);
|
}, unsupported, 'File', '_getLocalFilesystemPath', [internalFilePath]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -835,13 +842,20 @@ exports.defineAutoTests = function () {
|
|||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var internalFilePath;
|
||||||
|
if (root.toInternalURL) {
|
||||||
|
internalFilePath = root.toInternalURL() + fileName;
|
||||||
|
} else {
|
||||||
|
internalFilePath = localFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
// This is an undocumented interface to File which exists only for testing
|
// This is an undocumented interface to File which exists only for testing
|
||||||
// backwards compatibilty. By obtaining the raw filesystem path of the download
|
// backwards compatibilty. By obtaining the raw filesystem path of the download
|
||||||
// location, we can pass that to transfer.download() to make sure that previously-stored
|
// location, we can pass that to transfer.download() to make sure that previously-stored
|
||||||
// paths are still valid.
|
// paths are still valid.
|
||||||
cordova.exec(function (localPath) {
|
cordova.exec(function (localPath) {
|
||||||
transfer.upload(localPath, fileURL, uploadWin, unexpectedCallbacks.httpFail, options);
|
transfer.upload(localPath, fileURL, uploadWin, unexpectedCallbacks.httpFail, uploadOptions);
|
||||||
}, unsupported, 'File', '_getLocalFilesystemPath', [localFilePath]);
|
}, unsupported, 'File', '_getLocalFilesystemPath', [internalFilePath]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user