4 <script src="jquery-1.4.2.min.js" type="text/javascript"></script>
6 <link href="qunit/qunit/qunit.css" rel="stylesheet" type="text/css" media="screen" />
7 <script src="qunit/qunit/qunit.js" type="text/javascript"></script>
9 <script src="../client/fileuploader.js" type="text/javascript" ></script>
13 function getHandler(){
14 if(qq.UploadHandlerXhr.isSupported()){
15 return qq.UploadHandlerXhr;
17 return qq.UploadHandlerForm;
21 asyncTest("upload", function() {
24 var data = {stringOne: 'rtdfghdfhfh',stringTwo: 'dfsgsdfgsdg',stringThree: 'dfsgfhdfhdg'};
27 var uploadHandler = new (getHandler())({
28 action: 'action-handler-queue-test.php',
30 onComplete: function(id, fileName, response){
31 if (!response.success){
32 ok(false, 'server did not receive file')
36 delete response.success;
37 delete response.qqfile;
39 same(response, data, 'server received file and data');
44 $('#testinput1, #testinput2').change(upload);
47 setTimeout(start, 9000);
50 if (uploadHandler instanceof qq.UploadHandlerXhr){
53 var id = uploadHandler.add(file);
54 uploadHandler.upload(id, data);
63 <h1 id="qunit-header">File uploader tests</h1>
64 <h2 id="qunit-banner"></h2>
65 <h2 id="qunit-userAgent"></h2>
66 <ol id="qunit-tests"></ol>
70 Please select a file for each input below,
71 should be less than 4 sec, between selection.
75 <input id="testinput1" type="file">
76 <input id="testinput2" type="file">