Skip to content

Commit

Permalink
Don't crash on low memory devices
Browse files Browse the repository at this point in the history
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 apache#166
  • Loading branch information
fujunwei authored and stevengill committed Nov 7, 2016
1 parent addf885 commit 9b322de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 9b322de

Please sign in to comment.