mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-05-31 00:00:07 +08:00
chore: fix broken CI build / test
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cordova": "10.0.0",
|
||||
"cordova-android": "9.0.0",
|
||||
"cordova-android": "10.1.1",
|
||||
"cordova-browser": "6.0.0",
|
||||
"cordova-ios": "6.2.0",
|
||||
"cordova-plugin-device": "2.0.3",
|
||||
|
||||
+19
-6
@@ -52,6 +52,19 @@ const helpers = {
|
||||
xhr.open('GET', url);
|
||||
xhr.send();
|
||||
},
|
||||
readFileEntryAsText: function(fileEntry, onSuccess, onFail) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onerror = onFail;
|
||||
|
||||
reader.onloadend = function() {
|
||||
onSuccess(reader.result);
|
||||
};
|
||||
|
||||
fileEntry.file(function(file) {
|
||||
reader.readAsText(file);
|
||||
}, onFail);
|
||||
},
|
||||
writeToFile: function (done, fileName, content) {
|
||||
window.resolveLocalFileSystemURL(cordova.file.cacheDirectory, function (directoryEntry) {
|
||||
directoryEntry.getFile(fileName, { create: true, exclusive: false }, function (fileEntry) {
|
||||
@@ -342,7 +355,7 @@ const tests = [
|
||||
var targetPath = cordova.file.cacheDirectory + 'test.xml';
|
||||
|
||||
cordova.plugin.http.downloadFile(sourceUrl, {}, {}, targetPath, function (entry) {
|
||||
helpers.getWithXhr(function (content) {
|
||||
helpers.readFileEntryAsText(entry, function(content) {
|
||||
resolve({
|
||||
sourceUrl: sourceUrl,
|
||||
targetPath: targetPath,
|
||||
@@ -350,7 +363,7 @@ const tests = [
|
||||
name: entry.name,
|
||||
content: content
|
||||
});
|
||||
}, targetPath);
|
||||
}, reject);
|
||||
}, reject);
|
||||
},
|
||||
validationFunc: function (driver, result) {
|
||||
@@ -520,7 +533,7 @@ const tests = [
|
||||
cordova.plugin.http.setCookie('http://httpbin.org/get', 'mySecondCookie=mySecondValue');
|
||||
|
||||
cordova.plugin.http.downloadFile(sourceUrl, {}, {}, targetPath, function (entry) {
|
||||
helpers.getWithXhr(function (content) {
|
||||
helpers.readFileEntryAsText(entry, function (content) {
|
||||
resolve({
|
||||
sourceUrl: sourceUrl,
|
||||
targetPath: targetPath,
|
||||
@@ -528,7 +541,7 @@ const tests = [
|
||||
name: entry.name,
|
||||
content: content
|
||||
});
|
||||
}, targetPath);
|
||||
}, reject);
|
||||
}, reject);
|
||||
},
|
||||
validationFunc: function (driver, result) {
|
||||
@@ -697,7 +710,7 @@ const tests = [
|
||||
var targetPath = cordova.file.cacheDirectory + 'test.xml';
|
||||
|
||||
cordova.plugin.http.downloadFile(sourceUrl, {}, {}, targetPath, function (entry) {
|
||||
helpers.getWithXhr(function (content) {
|
||||
helpers.readFileEntryAsText(entry, function (content) {
|
||||
resolve({
|
||||
sourceUrl: sourceUrl,
|
||||
targetPath: targetPath,
|
||||
@@ -705,7 +718,7 @@ const tests = [
|
||||
name: entry.name,
|
||||
content: content
|
||||
});
|
||||
}, targetPath);
|
||||
}, reject);
|
||||
}, reject);
|
||||
},
|
||||
validationFunc: function (driver, result) {
|
||||
|
||||
@@ -64,7 +64,7 @@ const configs = {
|
||||
os_version: '14',
|
||||
project: 'HTTP Test App',
|
||||
autoWebview: true,
|
||||
app: 'HttpTestAppAndroid',
|
||||
app: 'HttpTestAppIos',
|
||||
'browserstack.networkLogs': false
|
||||
},
|
||||
browserstackAndroidDevice: {
|
||||
|
||||
Reference in New Issue
Block a user