• andersca@apple.com's avatar
    Test that we call NPP_DestroyStream if a plug-in returns -1 from its NPP_Write function · 748ed604
    andersca@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=41821
    
    Reviewed by Sam Weinig.
    
    WebKitTools:
    
    * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
    (pluginGetProperty):
    (pluginSetProperty):
    (pluginAllocate):
    * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
    Add and initialize the returnNegativeOneFromWrite property.
    
    * DumpRenderTree/TestNetscapePlugIn/main.cpp:
    (NPP_NewStream):
    Set the stream type to NP_NORMAL so we'll get write callbacks.
    
    (NPP_DestroyStream):
    Treat the onstreamdestroy attribute as a function name and not a string.
    
    (NPP_WriteReady):
    Have this return a nonzero value.
    
    (NPP_Write):
    If returnNegativeOneFromWrite is true return -1.
    
    LayoutTests:
    
    * plugins/return-error-from-new-stream-doesnt-invoke-destroy-stream.html:
    Update for changes to onstreamdestroy.
    
    * plugins/return-negative-one-from-write-expected.txt: Added.
    * plugins/return-negative-one-from-write.html: Added.
    Add new test.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    748ed604
return-negative-one-from-write-expected.txt 351 Bytes