cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject spec commit: [CB-2388] Fixes blob test failing when unsupported
Date Wed, 06 Feb 2013 18:44:40 GMT
Updated Branches:
  refs/heads/master 66a4bd7f0 -> 4af4992de


[CB-2388] Fixes blob test failing when unsupported


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/4af4992d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/4af4992d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/4af4992d

Branch: refs/heads/master
Commit: 4af4992de85c4ac09a8100d8a10ba6fbc1da25e0
Parents: 66a4bd7
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Wed Feb 6 13:43:06 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Feb 6 13:43:06 2013 -0500

----------------------------------------------------------------------
 autotest/tests/file.tests.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/4af4992d/autotest/tests/file.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/file.tests.js b/autotest/tests/file.tests.js
index 45a789f..ebf7de8 100644
--- a/autotest/tests/file.tests.js
+++ b/autotest/tests/file.tests.js
@@ -3005,8 +3005,6 @@ describe('File API', function() {
 
             waitsFor(function() { return verifier.wasCalled; }, "verifier never called",
Tests.TEST_TIMEOUT);
         });
-        // This test fails on Android <= 2.3 and iOS <= 5 due to a lack of
-        // Blob creation on these platforms.
         it("should be able to read native blob objects", function() {
             var contents = 'asdf';
             var uint8Array = new Uint8Array(contents.length);
@@ -3022,9 +3020,14 @@ describe('File API', function() {
                 blob = builder.getBlob("text/plain");
             } else {
                 // iOS 6 does not support Views here.
-                blob = new Blob([uint8Array.buffer, contents]);
+                try {
+                    blob = new Blob([uint8Array.buffer, contents]);
+                } catch (e) {
+                    // Skip the test if we can't create a blob.
+                    // This happens on Android <= 2.3 and iOS <= 5.
+                    return;
+                }
             }
-
             var verifier = jasmine.createSpy().andCallFake(function(evt) {
                 expect(evt).toBeDefined();
                 expect(evt.target.result).toBe('asdfasdf');


Mime
View raw message