@@ -341,17 +341,22 @@ describe('Promise', ifEnvSupports('Promise', function () {
341341 } ) ;
342342 } ) ;
343343
344- it ( 'should work for blob response' , function ( done ) {
345- testZone . run ( function ( ) {
346- global [ 'fetch' ] ( '/base/test/assets/sample.json' ) . then ( function ( response : any ) {
344+ it ( 'should work for blob response' , function ( done ) {
345+ testZone . run ( function ( ) {
346+ global [ 'fetch' ] ( '/base/test/assets/sample.json' ) . then ( function ( response :any ) {
347347 var fetchZone = Zone . current ;
348348 expect ( fetchZone ) . toBe ( testZone ) ;
349349
350- response . blob ( ) . then ( function ( blob ) {
351- expect ( Zone . current ) . toBe ( fetchZone ) ;
352- expect ( blob instanceof Blob ) . toEqual ( true ) ;
350+ // Android 4.3- doesn't support response.blob()
351+ if ( response . blob ) {
352+ response . blob ( ) . then ( function ( blob ) {
353+ expect ( Zone . current ) . toBe ( fetchZone ) ;
354+ expect ( blob instanceof Blob ) . toEqual ( true ) ;
355+ done ( ) ;
356+ } ) ;
357+ } else {
353358 done ( ) ;
354- } ) ;
359+ }
355360 } ) ;
356361 } ) ;
357362 } ) ;
@@ -362,13 +367,19 @@ describe('Promise', ifEnvSupports('Promise', function () {
362367 var fetchZone = Zone . current ;
363368 expect ( fetchZone ) . toBe ( testZone ) ;
364369
365- response . arrayBuffer ( ) . then ( function ( blob ) {
366- expect ( Zone . current ) . toBe ( fetchZone ) ;
367- expect ( blob instanceof ArrayBuffer ) . toEqual ( true ) ;
370+ // Android 4.3- doesn't support response.arrayBuffer()
371+ if ( response . arrayBuffer ) {
372+ response . arrayBuffer ( ) . then ( function ( blob ) {
373+ expect ( Zone . current ) . toBe ( fetchZone ) ;
374+ expect ( blob instanceof ArrayBuffer ) . toEqual ( true ) ;
375+ done ( ) ;
376+ } ) ;
377+ } else {
368378 done ( ) ;
369- } ) ;
379+ }
370380 } ) ;
371381 } ) ;
372382 } ) ;
383+
373384 } ) ) ;
374385} ) ) ;
0 commit comments