| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <body> | |
| 3 This tests that NPP_URLNotify gets called exactly once for canceled streams on p
lugin removal. | |
| 4 <div id="result">FAILURE</div> | |
| 5 <embed name="plg" type="application/x-webkit-test-netscape"></embed> | |
| 6 <script> | |
| 7 var callbackRun = false; | |
| 8 function callback() | |
| 9 { | |
| 10 if (callbackRun) { | |
| 11 result.textContent = "FAILURE - callback run twice"; | |
| 12 return; | |
| 13 } | |
| 14 | |
| 15 callbackRun = true; | |
| 16 result.textContent = "SUCCESS"; | |
| 17 // Force the plugin to spin a nested event loop. | |
| 18 alert("Request completed"); | |
| 19 // Don't stop the test until a small delay, in case callback is called a
gain. | |
| 20 setTimeout(notify, 50); | |
| 21 } | |
| 22 function notify() | |
| 23 { | |
| 24 if (window.testRunner) | |
| 25 testRunner.notifyDone(); | |
| 26 } | |
| 27 if (window.testRunner) { | |
| 28 testRunner.dumpAsText(); | |
| 29 testRunner.waitUntilDone(); | |
| 30 } | |
| 31 | |
| 32 plg.getURLNotify("resources/slow-resource.pl", null, "callback"); | |
| 33 // Remove the plugin after a short delay (to give the resource time to | |
| 34 // propagate through the system to the browser). | |
| 35 setTimeout(function() { | |
| 36 plg.parentNode.removeChild(plg); | |
| 37 }, 50); | |
| 38 </script> | |
| 39 </body> | |
| 40 </html> | |
| OLD | NEW |