Skip to content

Commit

Permalink
[CB-2388] Fixes blob test failing when unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
agrieve committed Feb 6, 2013
1 parent 66a4bd7 commit 4af4992
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions autotest/tests/file.tests.js
Expand Up @@ -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);
Expand All @@ -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');
Expand Down

0 comments on commit 4af4992

Please sign in to comment.