You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/07 22:06:57 UTC

[2/6] git commit: Fixed failing spec.19 on wp8

Fixed failing spec.19 on wp8

Also removed duplicate test


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/3b4afc86
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/3b4afc86
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/3b4afc86

Branch: refs/heads/master
Commit: 3b4afc8606b21a755e8dc8c2e73bd418ad47a6ce
Parents: 5c32f65
Author: Staci Cooper <sm...@us.ibm.com>
Authored: Mon Jul 28 15:57:29 2014 -0400
Committer: Staci Cooper <sm...@us.ibm.com>
Committed: Mon Jul 28 15:57:29 2014 -0400

----------------------------------------------------------------------
 test/tests.js | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/3b4afc86/test/tests.js
----------------------------------------------------------------------
diff --git a/test/tests.js b/test/tests.js
index ceb2b9b..2eedd95 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -524,6 +524,9 @@ exports.defineAutoTests = function () {
                     } catch (e) {
                         expect(obj).not.toBeNull('returned data from server should be valid json');
                     }
+                    expect(lastProgressEvent).not.toBeNull('expected progress events');
+                    expect(lastProgressEvent.loaded).toBeGreaterThan(1, 'loaded');
+                    expect(lastProgressEvent.total).not.toBeLessThan(lastProgressEvent.loaded);
                     done();
                 };
 
@@ -544,34 +547,6 @@ exports.defineAutoTests = function () {
                 };
 
                 writeFile(localFileName, fileContents, fileWin, fileFail);
-
-                expect(lastProgressEvent).not.toBeNull('expected progress events');
-                expect(lastProgressEvent.loaded).toBeGreaterThan(1, 'loaded');
-                expect(lastProgressEvent.total).not.toBeLessThan(lastProgressEvent.loaded);
-            });
-            it("filetransfer.spec.6 should get http status on basic auth failure", function (done) {
-                var uploadWin = createFail(done, "Upload success callback should not have been called");
-                var fileFail = createFail(done, "Error writing file to be uploaded");
-                var remoteFile = server + "/upload_basic_auth";
-                localFileName = "upload_expect_fail.txt";
-                var uploadFail = function (error) {
-                    expect(error.http_status).toBe(401);
-                    expect(error.http_status).not.toBe(404, "Ensure " + remoteFile + " is in the white list");
-                    done();
-                };
-
-                var fileWin = function (fileEntry) {
-                    var ft = new FileTransfer();
-
-                    var options = new FileUploadOptions();
-                    options.fileKey = "file";
-                    options.fileName = fileEntry.name;
-                    options.mimeType = "text/plain";
-
-                    ft.upload(fileEntry.toURL(), remoteFile, uploadWin, uploadFail, options);
-                };
-
-                writeFile(localFileName, "this file should fail to upload", fileWin, fileFail);
             });
             it("filetransfer.spec.21 should be stopped by abort() right away.", function (done) {
                 var uploadWin = createFail(done, "Upload success callback should not have been called");