File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 12451245 return ;
12461246 case 1 :
12471247 return ;
1248- case 2 :
1249- break ;
12501248 }
12511249 }
12521250 if ( this . flowObj . opts . testChunks && ! this . tested ) {
12931291 * @returns {string } 'pending', 'uploading', 'success', 'error'
12941292 */
12951293 status : function ( ) {
1296- if ( this . pendingRetry ) {
1294+ if ( this . pendingRetry || this . preprocessState === 1 ) {
12971295 // if pending retry then that's effectively the same as actively uploading,
12981296 // there might just be a slight delay before the retry starts
12991297 return 'uploading' ;
Original file line number Diff line number Diff line change @@ -388,6 +388,25 @@ describe('upload file', function() {
388388 expect ( error ) . not . toHaveBeenCalled ( ) ;
389389 } ) ;
390390
391+
392+
393+ it ( 'should preprocess chunks and wait for preprocess to finish' , function ( ) {
394+ flow . opts . simultaneousUploads = 1 ;
395+ var preprocess = jasmine . createSpy ( 'preprocess' ) ;
396+ flow . opts . preprocess = preprocess ;
397+ flow . addFile ( new Blob ( [ 'abc' ] ) ) ;
398+ flow . addFile ( new Blob ( [ 'abca' ] ) ) ;
399+ var file = flow . files [ 0 ] ;
400+ var secondFile = flow . files [ 1 ] ;
401+ flow . upload ( ) ;
402+ expect ( requests . length ) . toBe ( 0 ) ;
403+ expect ( preprocess ) . wasCalledWith ( file . chunks [ 0 ] ) ;
404+ expect ( preprocess ) . wasNotCalledWith ( secondFile . chunks [ 0 ] ) ;
405+
406+ flow . upload ( ) ;
407+ expect ( preprocess ) . wasNotCalledWith ( secondFile . chunks [ 0 ] ) ;
408+ } ) ;
409+
391410 it ( 'should have upload speed' , function ( ) {
392411 var clock = sinon . useFakeTimers ( ) ;
393412 flow . opts . testChunks = false ;
You can’t perform that action at this time.
0 commit comments