Skip to content

Commit

Permalink
Extended XHR helper so it is possible to manually set upload interval.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Feb 20, 2018
1 parent 8f999eb commit 3fb8311
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/plugins/uploadwidget/manual/_helpers/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict';

// Mock the real XMLHttpRequest so the upload test may work locally.
// Upload interval is by default set to 400ms. It can be redefined by setting 'window.XMLHttpRequestInterval'.

window.FormData = function() {
var total, uploadedFilename;
Expand Down Expand Up @@ -74,7 +75,7 @@ window.XMLHttpRequest = function() {
xhr.responseText = JSON.stringify( responseData );
onload();
}
}, 400 );
}, window.XMLHttpRequestInterval || 400 );
},

// Abort should call onabort.
Expand Down

0 comments on commit 3fb8311

Please sign in to comment.