chore: remove deprecated file transfer plugin (#634)

This commit is contained in:
エリス 2020-07-23 20:16:36 +09:00 committed by GitHub
parent e2ecd7fe91
commit 3f42591363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 27 deletions

View File

@ -26,8 +26,6 @@
<name>Cordova Camera Plugin Tests</name> <name>Cordova Camera Plugin Tests</name>
<license>Apache 2.0</license> <license>Apache 2.0</license>
<dependency id="cordova-plugin-file-transfer" />
<js-module src="tests.js" name="tests"> <js-module src="tests.js" name="tests">
</js-module> </js-module>
</plugin> </plugin>

View File

@ -19,7 +19,7 @@
* *
*/ */
/* globals Camera, resolveLocalFileSystemURL, FileEntry, CameraPopoverOptions, FileTransfer, FileUploadOptions, LocalFileSystem, MSApp */ /* globals Camera, resolveLocalFileSystemURL, FileEntry, CameraPopoverOptions, LocalFileSystem, MSApp */
/* eslint-env jasmine */ /* eslint-env jasmine */
exports.defineAutoTests = function () { exports.defineAutoTests = function () {
@ -167,26 +167,6 @@ exports.defineManualTests = function (contentEl, createActionButton) {
}; };
} }
function uploadImage () {
var ft = new FileTransfer();
var options = new FileUploadOptions();
options.fileKey = 'photo';
options.fileName = 'test.jpg';
options.mimeType = 'image/jpeg';
ft.onprogress = function (progressEvent) {
console.log('progress: ' + progressEvent.loaded + ' of ' + progressEvent.total);
};
var server = 'http://sheltered-retreat-43956.herokuapp.com';
ft.upload(pictureUrl, server + '/upload', win, fail, options);
function win (information_back) {
log('upload complete');
}
function fail (message) {
log('upload failed: ' + JSON.stringify(message));
}
}
function logCallback (apiName, success) { function logCallback (apiName, success) {
return function () { return function () {
log('Call to ' + apiName + (success ? ' success: ' : ' failed: ') + JSON.stringify([].slice.call(arguments))); log('Call to ' + apiName + (success ? ' success: ' : ' failed: ') + JSON.stringify([].slice.call(arguments)));
@ -498,10 +478,6 @@ exports.defineManualTests = function (contentEl, createActionButton) {
writeImage(); writeImage();
}, 'write'); }, 'write');
createActionButton('Upload Image', function () {
uploadImage();
}, 'upload');
createActionButton('Draw Using Canvas', function () { createActionButton('Draw Using Canvas', function () {
displayImageUsingCanvas(); displayImageUsingCanvas();
}, 'draw_canvas'); }, 'draw_canvas');