Skip to content

Commit 00e00b0

Browse files
alsorokinsgrebnov
authored andcommitted
CB-8844 Increased timeout for asset tests
github close apache#116
1 parent 597e2d4 commit 00e00b0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/tests.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ exports.defineAutoTests = function () {
3030
var isIndexedDBShim = isBrowser && !isChrome; // Firefox and IE for example
3131

3232
var isWindows = (cordova.platformId === "windows" || cordova.platformId === "windows8");
33+
34+
var MEDIUM_TIMEOUT = 15000;
35+
var LONG_TIMEOUT = 60000;
3336

3437
describe('File API', function () {
3538
// Adding a Jasmine helper matcher, to report errors when comparing to FileError better.
@@ -3456,7 +3459,7 @@ exports.defineAutoTests = function () {
34563459
describe('asset: URLs', function() {
34573460
it("file.spec.141 filePaths.applicationStorage", function() {
34583461
expect(cordova.file.applicationDirectory).toEqual('file:///android_asset/');
3459-
});
3462+
}, MEDIUM_TIMEOUT);
34603463
it("file.spec.142 assets should be enumerable", function(done) {
34613464
resolveLocalFileSystemURL('file:///android_asset/www/', function(entry) {
34623465
var reader = entry.createReader();
@@ -3465,7 +3468,7 @@ exports.defineAutoTests = function () {
34653468
done();
34663469
}, failed.bind(null, done, 'reader.readEntries - Error during reading of entries from assets directory'));
34673470
}, failed.bind(null, done, 'resolveLocalFileSystemURL failed for assets'));
3468-
});
3471+
}, LONG_TIMEOUT);
34693472
it("file.spec.143 copyTo: asset -> temporary", function(done) {
34703473
var file2 = "entry.copy.file2b",
34713474
fullPath = joinURL(temp_root.fullPath, file2),
@@ -3488,7 +3491,7 @@ exports.defineAutoTests = function () {
34883491
temp_root.getFile(file2, {}, function (entry) {
34893492
entry.remove(transfer, failed.bind(null, done, 'entry.remove - Error removing file: ' + file2));
34903493
}, transfer);
3491-
});
3494+
}, MEDIUM_TIMEOUT);
34923495
});
34933496
it("file.spec.144 copyTo: asset directory", function (done) {
34943497
var srcUrl = 'file:///android_asset/www/plugins/cordova-plugin-file';
@@ -3523,7 +3526,7 @@ exports.defineAutoTests = function () {
35233526
}, failed.bind(null, done, 'directory.copyTo - Error copying directory'));
35243527
}, failed.bind(null, done, 'resolving src dir'));
35253528
}, failed.bind(null, done, 'deleteEntry - Error removing directory : ' + dstDir));
3526-
});
3529+
}, LONG_TIMEOUT);
35273530
}
35283531
});
35293532

0 commit comments

Comments
 (0)