Skip to content

Commit

Permalink
Tests: Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayarjo committed Aug 9, 2015
1 parent 6c15ec8 commit e058512
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
13 changes: 11 additions & 2 deletions tests/auto/Uploader.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
up.bind('QueueChanged', function(up) {
up.trigger('TestQueueChanged');
});

up.bind('Error', function(up, err) {
up.trigger('TestError', err);
});
},

teardown: function() {
Expand Down Expand Up @@ -268,9 +272,14 @@
var oldValue = this.up.getOption('multi_selection');
var newValue = !oldValue;

this.up.setOption('multi_selection', newValue);
this.up.bind('TestError', function(up, err) {
start();

notEqual(oldValue, this.up.getOption('multi_selection'), "Option successfully changed.");
equal(err.code, plupload.OPTION_ERROR, "Options that require reinitialisation throw plupload.OPTION_ERROR.");
});

stop();
this.up.setOption('multi_selection', newValue);
});


Expand Down
19 changes: 15 additions & 4 deletions tests/auto/Uploader.init.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@
drag_and_drop: true,
slice_blob: true,
send_binary_string: true,
send_custom_headers: true
send_custom_headers: true,
use_http_method: "POST"
}, "required_features properly normalized and translated to caps.");
});

Expand Down Expand Up @@ -211,11 +212,21 @@
silverlight_xap_url : 'js/Moxie.xap',
max_upload_slots: 1,
filters : {
mime_types: false,
prevent_duplicates: false,
max_file_size: 0,
mime_types: []
max_file_size: 0
},
required_features: {}
required_features: {},
http_method: "POST",
file_data_name: "file",
chunk_size: 0,
max_retries: 0,
multipart: true,
multipart_params: {},
required_features: {},
resize: false,
send_chunk_number: true,
send_file_name: true,
}, "Proper defaults set.");
});

Expand Down
4 changes: 2 additions & 2 deletions tests/auto/Uploading.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
"If Content-Type supplied it should be used instead of default (application/octet-stream).");

var urlParts = meta.url.split(/\?/);
ok(!urlParts[1] || !/(?:^|[\?&]?)name=/.test(urlParts[1]),
"name argument not sent when send_file_name=false.");
ok(urlParts[1] && /(?:^|[\?&]?)name=/.test(urlParts[1]),
"name argument will be sent even if send_file_name=false.");
}
}
});
Expand Down

0 comments on commit e058512

Please sign in to comment.