| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <title>Test case for bug 40952</title> | 3 <title>Test case for bug 40952</title> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 4
0952</a>: Onloadend event is not supported in XMLHttpRequest</p> | 6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 4
0952</a>: Onloadend event is not supported in XMLHttpRequest</p> |
| 7 <p> Verify that a loadend ProgressEvent is dispatched after the abort ProgressEv
ent when an async upload request is aborted.</p> | 7 <p> Verify that a loadend ProgressEvent is dispatched after the abort ProgressEv
ent when an async upload request is aborted.</p> |
| 8 <p>PASS should appear below:</p> | 8 <p>PASS should appear below:</p> |
| 9 <p id=console></p> | 9 <p id=console></p> |
| 10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
| 11 if (window.testRunner) { | 11 if (window.testRunner) { |
| 12 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
| 13 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function log(message) | 16 function log(message) |
| 17 { | 17 { |
| 18 var consoleElt = document.getElementById("console"); | 18 var consoleElt = document.getElementById("console"); |
| 19 consoleElt.appendChild(document.createTextNode(message)); | 19 consoleElt.appendChild(document.createTextNode(message)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 var xhr = new XMLHttpRequest(); | 22 var xhr = new XMLHttpRequest(); |
| 23 var results = ""; | 23 var results = ""; |
| 24 var expected = " progress abort loadend"; | 24 var expected = " progress progress abort loadend"; |
| 25 | 25 |
| 26 function logProgressEvent(e) { | 26 function logProgressEvent(e) { |
| 27 results += " " + e.type; | 27 results += " " + e.type; |
| 28 } | 28 } |
| 29 | 29 |
| 30 function logUnexpectedProgressEvent(e) { | 30 function logUnexpectedProgressEvent(e) { |
| 31 results += " [unexpected ProgressEvent: " + e.type + "]"; | 31 results += " [unexpected ProgressEvent: " + e.type + "]"; |
| 32 completeTest(); | 32 completeTest(); |
| 33 } | 33 } |
| 34 | 34 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 xhr.open("POST", "resources/post-echo.cgi", true); | 56 xhr.open("POST", "resources/post-echo.cgi", true); |
| 57 xhr.send("data"); | 57 xhr.send("data"); |
| 58 } | 58 } |
| 59 | 59 |
| 60 test(); | 60 test(); |
| 61 | 61 |
| 62 </script> | 62 </script> |
| 63 </body> | 63 </body> |
| 64 | 64 |
| OLD | NEW |