You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/06/21 02:17:59 UTC

git commit: updated tests

Updated Branches:
  refs/heads/master 896eebffe -> fc2e95e3c


updated tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/fc2e95e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/fc2e95e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/fc2e95e3

Branch: refs/heads/master
Commit: fc2e95e3c97fc908d619ba783ea25351006aa94f
Parents: 896eebf
Author: Steven Gill <st...@gmail.com>
Authored: Thu Jun 20 17:17:56 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Thu Jun 20 17:17:56 2013 -0700

----------------------------------------------------------------------
 test/autotest/tests/file.tests.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/fc2e95e3/test/autotest/tests/file.tests.js
----------------------------------------------------------------------
diff --git a/test/autotest/tests/file.tests.js b/test/autotest/tests/file.tests.js
index c481ed3..3ebaffc 100644
--- a/test/autotest/tests/file.tests.js
+++ b/test/autotest/tests/file.tests.js
@@ -2933,7 +2933,7 @@ describe('File API', function() {
         });
         it("file.spec.83 should be able to read native blob objects", function() {
             // Skip test if blobs are not supported (e.g.: Android 2.3).
-            if (typeof Blob == 'undefined') {
+            if (typeof window.Blob == 'undefined' || typeof window.Uint8Array == 'undefined') {
                 return;
             }
             var contents = 'asdf';
@@ -3049,6 +3049,10 @@ describe('File API', function() {
             });
         });
         it("file.spec.87 should read file properly, readAsArrayBuffer", function() {
+            // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3).
+            if (typeof window.ArrayBuffer == 'undefined') {
+                return;
+            }
             runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) {
                 expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString)).toBe(true);
             });
@@ -3085,6 +3089,10 @@ describe('File API', function() {
             }, -10, -5);
         });
         it("file.spec.94 should read sliced file properly, readAsArrayBuffer", function() {
+            // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3).
+            if (typeof window.ArrayBuffer == 'undefined') {
+                return;
+            }
             runReaderTest('readAsArrayBuffer', true, function(evt, fileData, fileDataAsBinaryString) {
                 expect(arrayBufferEqualsString(evt.target.result, fileDataAsBinaryString.slice(0, -1))).toBe(true);
             }, 0, -1);
@@ -3473,6 +3481,10 @@ describe('File API', function() {
             });
         });
         it("file.spec.104 should be able to write binary data from an ArrayBuffer", function() {
+            // Skip test if ArrayBuffers are not supported (e.g.: Android 2.3).
+            if (typeof window.ArrayBuffer == 'undefined') {
+                return;
+            }
             var fileName = "bufferwriter.bin",
                 filePath = root.fullPath + '/' + fileName,
                 theWriter,
@@ -3515,6 +3527,10 @@ describe('File API', function() {
             });
         });
         it("file.spec.105 should be able to write binary data from a Blob", function() {
+            // Skip test if Blobs are not supported (e.g.: Android 2.3).
+            if (typeof window.Blob == 'undefined' || typeof window.ArrayBuffer == 'undefined') {
+                return;
+            }
             var fileName = "blobwriter.bin",
                 filePath = root.fullPath + '/' + fileName,
                 theWriter,