Andrew Top | 61a8495 | 2019-04-30 15:07:33 -0700 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html lang=en> |
| 3 | <meta charset=utf-8> |
| 4 | <title>XMLHttpRequest: upload progress event</title> |
| 5 | <script src="/resources/testharness.js"></script> |
| 6 | <script src="/resources/testharnessreport.js"></script> |
| 7 | <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onprogress" data-tested-assertations="../.." /> |
| 8 | <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]" /> |
| 9 | <link rel="help" href="https://xhr.spec.whatwg.org/#make-upload-progress-notifications" data-tested-assertations=".. ../following::ul/li[1]" /> |
| 10 | <link rel="help" href="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-upload" data-tested-assertations=".." /> |
| 11 | |
| 12 | <div id="log"></div> |
| 13 | <script> |
| 14 | var test = async_test(); |
| 15 | test.step(function() { |
| 16 | var client = new XMLHttpRequest(); |
| 17 | client.upload.onprogress = test.step_func(function() { |
| 18 | test.done(); |
| 19 | }); |
| 20 | client.onreadystatechange = test.step_func(function() { |
| 21 | if (client.readyState === 4) assert_unreached("onprogress not called."); |
| 22 | }); |
| 23 | client.open("POST", "resources/upload.py"); |
| 24 | client.send("This is a test string."); |
| 25 | }); |
| 26 | </script> |