chore: auto fix some indentations

This commit is contained in:
Sefa Ilkimen 2020-10-13 00:22:42 +02:00
parent fcedfae1ac
commit 6a60058fc6
No known key found for this signature in database
GPG Key ID: 4AB0B60A9B5E59F5
3 changed files with 16 additions and 14 deletions

View File

@ -407,9 +407,9 @@ cordova.plugin.http.downloadFile("https://google.com/", {
### abort<a name="abort"></a>
Abort a HTTP request. Takes the `requestId` which is returned by [sendRequest](#sendRequest) and its shorthand functions ([post](#post), [get](#get), [put](#put), [patch](#patch), [delete](#delete), [head](#head), [uploadFile](#uploadFile) and [downloadFile](#downloadFile)).
If the request already has finished, the request will finish normally and the abort call result will be `{aborted: false}`.
If the request already has finished, the request will finish normally and the abort call result will be `{ aborted: false }`.
If the request is still in progress, the request's `failure` callback will be invoked with response `{status: -8}`, and the abort call result `{aborted: true}`.
If the request is still in progress, the request's `failure` callback will be invoked with response `{ status: -8 }`, and the abort call result `{ aborted: true }`.
:warning: Not supported for Android < 6 (API level < 23). For Android 5.1 and below, calling `abort(reqestId)` will have no effect, i.e. the requests will finish as if the request was not cancelled.

View File

@ -85,8 +85,8 @@ const helpers = {
result.type.should.be.equal(expected);
},
isAbortSupported: function () {
if(window.cordova && window.cordova.platformId === 'android'){
var version = device.version;//NOTE will throw error if cordova is present without cordova-plugin-device
if (window.cordova && window.cordova.platformId === 'android') {
var version = device.version; //NOTE will throw error if cordova is present without cordova-plugin-device
var major = parseInt(/^(\d+)(\.|$)/.exec(version)[1], 10);
return isFinite(major) && major >= 6;
}
@ -1009,7 +1009,7 @@ const tests = [
helpers.getWithXhr(function (buffer) {
var reqId = cordova.plugin.http.post('http://httpbin.org/anything', buffer, {}, resolve, reject);
setTimeout(function(){
setTimeout(function () {
cordova.plugin.http.abort(reqId);
}, helpers.getAbortDelay());
@ -1039,7 +1039,7 @@ const tests = [
};
var reqId = cordova.plugin.http.sendRequest(url, options, success, reject);
setTimeout(function(){
setTimeout(function () {
cordova.plugin.http.abort(reqId);
}, helpers.getAbortDelay());
},
@ -1071,14 +1071,14 @@ const tests = [
}, targetPath);
}, reject);
setTimeout(function(){
setTimeout(function () {
cordova.plugin.http.abort(reqId);
}, helpers.getAbortDelay());
},
validationFunc: function (driver, result) {
helpers.checkResult(result, 'rejected');
result.data.status.should.be.equal(-8);
helpers.checkResult(result, 'rejected');
result.data.status.should.be.equal(-8);
}
},
{
@ -1098,15 +1098,15 @@ const tests = [
var reqId = cordova.plugin.http.uploadFile(targetUrl, {}, {}, sourcePath, fileName, resolve, reject);
setTimeout(function(){
setTimeout(function () {
cordova.plugin.http.abort(reqId);
}, helpers.getAbortDelay());
}, fileName, fileContent);
},
validationFunc: function (driver, result) {
helpers.checkResult(result, 'rejected');
result.data.status.should.be.equal(-8);
helpers.checkResult(result, 'rejected');
result.data.status.should.be.equal(-8);
}
},
];

View File

@ -49,13 +49,15 @@ describe('Advanced HTTP e2e test suite', function () {
});
const defineTestForMocha = (test, index) => {
it(index + ': ' + test.description, async function() {
it(index + ': ' + test.description, async function () {
await clickNext(driver);
await validateTestIndex(driver, index);
await validateTestTitle(driver, test.description);
await waitToBeFinished(driver, test.timeout || 10000);
const skipped = await checkSkipped(driver);
if(skipped){
if (skipped) {
this.skip();
} else {
await validateResult(driver, test.validationFunc, targetInfo);