Don't crash on low memory devices It will be OOM when running file-transfer tests on baseline Android Memory class which is 16M (It happens to be the java heap limit of those devices).
This closes #166 Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/9b322dec Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/9b322dec Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/9b322dec Branch: refs/heads/1.6.x Commit: 9b322dec6790f6d273b8f707bc07976d778c4cf6 Parents: addf885 Author: junweifu <junwei...@intel.com> Authored: Fri Nov 4 10:23:11 2016 +0800 Committer: Steve Gill <stevengil...@gmail.com> Committed: Mon Nov 7 11:05:28 2016 -0800 ---------------------------------------------------------------------- tests/tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/9b322dec/tests/tests.js ---------------------------------------------------------------------- diff --git a/tests/tests.js b/tests/tests.js index cc88eda..7149091 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -58,6 +58,7 @@ exports.defineAutoTests = function () { var isBrowser = cordova.platformId === "browser"; var isIE = isBrowser && navigator.userAgent.indexOf("Trident") >= 0; var isIos = cordova.platformId === "ios"; + var isIot = cordova.platformId === "android" && navigator.userAgent.indexOf("iot") >= 0; // tests describe("FileTransferError", function () { @@ -1078,7 +1079,7 @@ exports.defineAutoTests = function () { // windows store and ios are too fast, win is called before we have a chance to abort // so let's get them busy - while not providing an extra load to the slow Android emulators - var arrayLength = ((isWindows && !isWindowsPhone81) || isIos) ? 3000000 : 200000; + var arrayLength = ((isWindows && !isWindowsPhone81) || isIos) ? 3000000 : isIot ? 150000 : 200000; writeFile(specContext.root, specContext.fileName, new Array(arrayLength).join("aborttest!"), fileWin, done); }, UPLOAD_TIMEOUT); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org