Skip to content

Commit

Permalink
Merge branch 't/13171' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Apr 13, 2015
2 parents 1f188a0 + ec1b135 commit 255747d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions tests/plugins/uploadwidget/manual/_helpers/xhrerror.js
Expand Up @@ -7,14 +7,31 @@

// Mock the real XMLHttpRequest so the upload test may show the effect of an error during upload.

window.FormData = function() {
var total, filename;
return {
append: function( name, file, filename ) {
total = file.size;
filename = filename;
},
getTotal: function() {
return total;
},
getFileName: function() {
return filename;
}
};
};

window.XMLHttpRequest = function() {
return {
open: function() {},

send: function() {
send: function( formData ) {
// Total file size.
var loaded = 0,
step = 10,
var total = formData.getTotal(),
loaded = 0,
step = Math.round( total / 10 ),
onprogress = this.onprogress,
onerror = this.onerror,
interval;
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/uploadwidget/manual/error.md
Expand Up @@ -7,5 +7,5 @@ This test emulates an error during upload. When upload hits 50% an error occurs.

* Drop an image.
* Check if `upload widget` is displayed.
* Check if image is removed after it reaches 50% of progress and no artifacts left.
* Check if image is removed when it reaches 50% of progress and no artifacts left.
* Check if you see a message about the error.

0 comments on commit 255747d

Please sign in to comment.