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 2013/06/15 06:39:34 UTC

spec commit: Skip tests properly on old Android versions

Updated Branches:
  refs/heads/master 31aae40f8 -> e31b38eb5


Skip tests properly on old Android versions


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/e31b38eb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/e31b38eb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/e31b38eb

Branch: refs/heads/master
Commit: e31b38eb503284005436412654e08186801436c5
Parents: 31aae40
Author: Ian Clelland <ic...@chromium.org>
Authored: Sat Jun 15 00:29:48 2013 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Sat Jun 15 00:29:48 2013 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/e31b38eb/autotest/tests/file.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/file.tests.js b/autotest/tests/file.tests.js
index c481ed3..3ebaffc 100644
--- a/autotest/tests/file.tests.js
+++ b/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,