test_XHR_onuploadprogress.html 929 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=743666
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 743666</title>
  9. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=743666">Mozilla Bug 743666</a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none">
  16. </div>
  17. <pre id="test">
  18. <script type="application/javascript">
  19. /** Test for Bug 743666 **/
  20. var called = false;
  21. function uploadprogress()
  22. {
  23. called = true;
  24. }
  25. var xhr = new XMLHttpRequest();
  26. xhr.upload.onprogress = uploadprogress;
  27. var event = new ProgressEvent("progress");
  28. xhr.upload.dispatchEvent(event);
  29. ok(called,
  30. "XMLHttpRequest.upload.onprogress sets upload progress event listener");
  31. </script>
  32. </pre>
  33. </body>
  34. </html>