| <script src="../fast/js/resources/js-test-pre.js"></script> |
| var newStreamCalled = false; |
| var destroyStreamCalled = false; |
| if (!window.layoutTestController) { |
| debug("This test can only run from within DumpRenderTree, because it requires TestNetscapePlugin.\n"); |
| layoutTestController.waitUntilDone(); |
| function streamStarted() { |
| shouldBeFalse('newStreamCalled'); |
| function streamDestroyed(reason) { |
| shouldBeTrue('newStreamCalled') |
| debug('<br><span class="pass">TEST COMPLETE</span>'); |
| layoutTestController.notifyDone(); |
| type="application/x-webkit-test-netscape" |
| onStreamLoad="streamStarted()" |
| onStreamDestroy="streamDestroyed" |
| description("This tests that NPP_DestroyStream is called with NPRES_NETWORK_ERR not called if a plug-in returns -1 its NPP_Write callback."); |
| var plugin = document.getElementById("plugin"); |
| plugin.returnNegativeOneFromWrite = true; |
| shouldBeTrue("plugin.returnNegativeOneFromWrite"); |
| plugin.getURLNotify("data:text/html,Test", null, "callback"); |