@@ -431,6 +431,30 @@ describe('upload file', function() {
431431 expect ( preprocess ) . wasNotCalledWith ( secondFile . chunks [ 0 ] ) ;
432432 } ) ;
433433
434+ it ( 'should resume preprocess chunks after pause' , function ( ) {
435+ flow . opts . chunkSize = 1 ;
436+ flow . opts . simultaneousUploads = 1 ;
437+ flow . opts . testChunks = false ;
438+ var preprocess = jasmine . createSpy ( 'preprocess' ) ;
439+ var error = jasmine . createSpy ( 'error' ) ;
440+ var success = jasmine . createSpy ( 'success' ) ;
441+ flow . on ( 'fileError' , error ) ;
442+ flow . on ( 'fileSuccess' , success ) ;
443+ flow . opts . preprocess = preprocess ;
444+ flow . addFile ( new Blob ( [ 'abc' ] ) ) ;
445+ var file = flow . files [ 0 ] ;
446+ flow . upload ( ) ;
447+ for ( var i = 0 ; i < file . chunks . length ; i ++ ) {
448+ expect ( preprocess ) . wasCalledWith ( file . chunks [ i ] ) ;
449+ file . chunks [ i ] . preprocessFinished ( ) ;
450+ file . pause ( ) ;
451+ file . resume ( ) ;
452+ requests [ requests . length - 1 ] . respond ( 200 , [ ] , "response" ) ;
453+ }
454+ expect ( success ) . wasCalledWith ( file , "response" , file . chunks [ file . chunks . length - 1 ] ) ;
455+ expect ( error ) . not . toHaveBeenCalled ( ) ;
456+ } ) ;
457+
434458 it ( 'should set chunk as a third event parameter' , function ( ) {
435459 var success = jasmine . createSpy ( 'success' ) ;
436460 flow . on ( 'fileSuccess' , success ) ;
0 commit comments