| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../resources/js-test.js"></script> | |
| 4 </head> | |
| 5 <body> | |
| 6 <p id="description"></p> | |
| 7 <div id="console"></div> | |
| 8 | |
| 9 <script> | |
| 10 var newStreamCalled = false; | |
| 11 var destroyStreamCalled = false; | |
| 12 | |
| 13 function main() { | |
| 14 if (!window.testRunner) { | |
| 15 debug("This test can only run from within DumpRenderTree, be
cause it requires TestNetscapePlugin.\n"); | |
| 16 return; | |
| 17 } | |
| 18 testRunner.waitUntilDone(); | |
| 19 } | |
| 20 | |
| 21 main(); | |
| 22 | |
| 23 function streamStarted() { | |
| 24 shouldBeFalse('newStreamCalled'); | |
| 25 newStreamCalled = true; | |
| 26 } | |
| 27 | |
| 28 function streamDestroyed(reason) { | |
| 29 window.reason = reason; | |
| 30 | |
| 31 shouldBeTrue('newStreamCalled') | |
| 32 shouldBe('reason', '1'); | |
| 33 | |
| 34 debug('<br><span class="pass">TEST COMPLETE</span>'); | |
| 35 | |
| 36 testRunner.notifyDone(); | |
| 37 } | |
| 38 </script> | |
| 39 | |
| 40 <embed | |
| 41 type="application/x-webkit-test-netscape" | |
| 42 onStreamLoad="streamStarted()" | |
| 43 onStreamDestroy="streamDestroyed" | |
| 44 id="plugin"> | |
| 45 </body> | |
| 46 <script> | |
| 47 description("This tests that NPP_DestroyStream is called with NPRES_NETW
ORK_ERR not called if a plugin returns -1 its NPP_Write callback."); | |
| 48 | |
| 49 var plugin = document.getElementById("plugin"); | |
| 50 | |
| 51 plugin.returnNegativeOneFromWrite = true; | |
| 52 shouldBeTrue("plugin.returnNegativeOneFromWrite"); | |
| 53 | |
| 54 plugin.getURLNotify("data:text/html,Test", null, "callback"); | |
| 55 </script> | |
| 56 </html> | |
| 57 | |
| OLD | NEW |