| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <title> Test case for bug 18655 </title> | |
| 4 </head> | |
| 5 <body> | |
| 6 <p> Test case for Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=18655">18
655</a>: [XHR] OnProgress needs more test case </p> | |
| 7 <p> This test verify that we implement both interfaces and that they match. </p> | |
| 8 <p> You should see PASSED twice. </p> | |
| 9 | |
| 10 <script type="text/javascript"> | |
| 11 var count = 0; | |
| 12 | |
| 13 function log (msg) | |
| 14 { | |
| 15 document.body.appendChild(document.createTextNode(msg)); | |
| 16 document.body.appendChild(document.createElement("br")); | |
| 17 } | |
| 18 | |
| 19 function onProgress(e) { | |
| 20 // Check if both interface match and they are not both null | |
| 21 // so that if it is not implemented it does not match. | |
| 22 if (e.position == e.loaded && e.loaded) | |
| 23 log("PASSED"); | |
| 24 else | |
| 25 log("FAILED position and loaded do not match (or both are null)"); | |
| 26 | |
| 27 if (e.totalSize == e.total && e.total) | |
| 28 log("PASSED"); | |
| 29 else | |
| 30 log("FAILED totalSize and total do not match (or both are null)"); | |
| 31 | |
| 32 if (++count == 1 && window.testRunner) | |
| 33 testRunner.notifyDone(); | |
| 34 } | |
| 35 | |
| 36 if (window.testRunner) { | |
| 37 testRunner.dumpAsText(); | |
| 38 testRunner.waitUntilDone(); | |
| 39 } | |
| 40 | |
| 41 var req = new XMLHttpRequest(); | |
| 42 req.onprogress = onProgress; | |
| 43 req.open("GET", "resources/1251.html", true); | |
| 44 req.send(null); | |
| 45 </script> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |