From 2bfbd2c78298bf6defef874fcafe5c4c9d4b6efc Mon Sep 17 00:00:00 2001 From: Ian Clelland Date: Wed, 17 Dec 2014 11:05:39 -0500 Subject: [PATCH] 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. --- tests/tests.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/tests.js b/tests/tests.js index c268cf6..240a83d 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -584,13 +584,20 @@ exports.defineAutoTests = function () { 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 // 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 // paths are still valid. cordova.exec(function (localPath) { transfer.download(fileURL, localPath, downloadWin, unexpectedCallbacks.httpFail); - }, unsupported, 'File', '_getLocalFilesystemPath', [localFilePath]); + }, unsupported, 'File', '_getLocalFilesystemPath', [internalFilePath]); }); }); @@ -835,13 +842,20 @@ exports.defineAutoTests = function () { 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 // 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 // paths are still valid. cordova.exec(function (localPath) { - transfer.upload(localPath, fileURL, uploadWin, unexpectedCallbacks.httpFail, options); - }, unsupported, 'File', '_getLocalFilesystemPath', [localFilePath]); + transfer.upload(localPath, fileURL, uploadWin, unexpectedCallbacks.httpFail, uploadOptions); + }, unsupported, 'File', '_getLocalFilesystemPath', [internalFilePath]); }); }); });