send-response-upload-event-progress.htm (1572B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onprogress" data-tested-assertations="../.." /> 5 <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-progress" data-tested-assertations="../.." /> 6 <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::a[contains(@href,'#make-upload-progress-notifications')]/.. following::ol[1]/li[8]" /> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#make-upload-progress-notifications" data-tested-assertations="following::ul[1]/li[2]/ol[1]/li[2]" /> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <title>XMLHttpRequest: The send() method: Fire a progress event named progress on the XMLHttpRequestUpload (synchronous flag is unset)</title> 11 </head> 12 13 <body> 14 <div id="log"></div> 15 16 <script type="text/javascript"> 17 var test = async_test(); 18 19 test.step(function() 20 { 21 var xhr = new XMLHttpRequest(); 22 23 xhr.upload.onprogress = function(e) 24 { 25 test.step(function() 26 { 27 assert_true(e instanceof ProgressEvent); 28 assert_equals(e.type, "progress"); 29 assert_equals(e.target, xhr.upload); 30 test.done(); 31 }); 32 }; 33 34 xhr.open("POST", "./resources/content.py", true); 35 xhr.send("Test Message"); 36 }); 37 </script> 38 </body> 39 </html>