You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/11/14 17:17:28 UTC
cordova-plugin-file-transfer git commit: CB-7944 Pended unsupported
auto tests for windows
Repository: cordova-plugin-file-transfer
Updated Branches:
refs/heads/master 60b020e59 -> 6fee83592
CB-7944 Pended unsupported auto tests for windows
This closes #48
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/6fee8359
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/6fee8359
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/6fee8359
Branch: refs/heads/master
Commit: 6fee8359287ff6c3e022ec6fd0826c293e440ad8
Parents: 60b020e
Author: maria.bukharina <ma...@akvelon.com>
Authored: Wed Nov 5 17:43:08 2014 +0300
Committer: Ian Clelland <ic...@chromium.org>
Committed: Fri Nov 14 11:16:48 2014 -0500
----------------------------------------------------------------------
tests/tests.js | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/6fee8359/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 6377096..fa4278f 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -20,6 +20,8 @@
*/
exports.defineAutoTests = function () {
+ var isWindows = (cordova.platformId == "windows") || (navigator.appVersion.indexOf("MSAppHost/1.0") !== -1);
+ var isWP81 = navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1;
describe('FileTransfer', function () {
// https://github.com/apache/cordova-labs/tree/cordova-filetransfer
@@ -239,6 +241,12 @@ exports.defineAutoTests = function () {
ft.download(remoteFile, root.toURL() + "/" + localFileName, downloadWin, downloadFail);
});
it("filetransfer.spec.7 should be able to download a file using file:// (when hosted from file://)", function (done) {
+ // for Windows platform it's ms-appdata:/// by default, not file://
+ if (isWindows) {
+ pending();
+ return;
+ }
+
var downloadFail = createFail(done, "Download error callback should not have been called");
var remoteFile = window.location.protocol + '//' + window.location.pathname.replace(/ /g, '%20');
localFileName = remoteFile.substring(remoteFile.lastIndexOf('/') + 1);
@@ -444,6 +452,11 @@ exports.defineAutoTests = function () {
});
it("filetransfer.spec.18 should be able to upload a file", function (done) {
+ // according to spec "onprogress" method doesn't supported on WP
+ if (isWP81) {
+ pending();
+ return;
+ }
var uploadFail = createFail(done, "Upload error callback should not have been called");
var fileFail = createFail(done, "Error writing file to be uploaded");
var remoteFile = server + "/upload";
@@ -497,6 +510,11 @@ exports.defineAutoTests = function () {
writeFile(localFileName, fileContents, fileWin, fileFail);
});
it("filetransfer.spec.19 should be able to upload a file with http basic auth", function (done) {
+ // according to spec "onprogress" method doesn't supported on WP
+ if (isWP81) {
+ pending();
+ return;
+ }
var uploadFail = createFail(done, "Upload error callback should not have been called");
var fileFail = createFail(done, "Error writing file to be uploaded");
var remoteFile = server_with_credentials + "/upload_basic_auth";
@@ -845,7 +863,11 @@ exports.defineAutoTests = function () {
expect(typeof entry.toNativeURL).toBe("function");
var nativeURL = entry.toNativeURL();
expect(typeof nativeURL).toBe("string");
- expect(nativeURL.substring(0, 7)).toBe('file://');
+ if (isWindows) {
+ expect(nativeURL.substring(0, 14)).toBe('ms-appdata:///'); //nativeURL prefix looks like that for Windows platform
+ } else {
+ expect(nativeURL.substring(0, 7)).toBe('file://');
+ }
done();
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org