Changeset 70662 in webkit


Ignore:
Timestamp:
Oct 27, 2010 10:13:35 AM (14 years ago)
Author:
Adam Roben
Message:

Reset TestNetscapePlugIn's NPP_GetValue pointer when NullNPPGetValuePointer finishes running

Fixes <http://webkit.org/b/48435> REGRESSION (r70655): Many plugins
tests are failing on Qt

Reviewed by Anders Carlsson.

  • DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:

(PluginTest::NPP_Destroy):

  • DumpRenderTree/TestNetscapePlugIn/PluginTest.h:

Added a do-nothing NPP_Destroy implementation.

  • DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp:

(NullNPPGetValuePointer::NullNPPGetValuePointer): Save the original
NPP_GetValue pointer in m_originalNPPGetValuePointer so we can restore
it later.
(NullNPPGetValuePointer::NPP_Destroy): Added. Restores the original
NPP_GetValue pointer so it can be used in other tests.

  • DumpRenderTree/TestNetscapePlugIn/main.cpp:

(NPP_Destroy):

  • DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:

(webkit_test_plugin_destroy_instance):
Call through to the PluginTest when NPP_Destroy is called.

Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r70658 r70662  
     12010-10-27  Adam Roben  <aroben@apple.com>
     2
     3        Reset TestNetscapePlugIn's NPP_GetValue pointer when
     4        NullNPPGetValuePointer finishes running
     5
     6        Fixes <http://webkit.org/b/48435> REGRESSION (r70655): Many plugins
     7        tests are failing on Qt
     8
     9        Reviewed by Anders Carlsson.
     10
     11        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
     12        (PluginTest::NPP_Destroy):
     13        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
     14        Added a do-nothing NPP_Destroy implementation.
     15
     16        * DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp:
     17        (NullNPPGetValuePointer::NullNPPGetValuePointer): Save the original
     18        NPP_GetValue pointer in m_originalNPPGetValuePointer so we can restore
     19        it later.
     20        (NullNPPGetValuePointer::NPP_Destroy): Added. Restores the original
     21        NPP_GetValue pointer so it can be used in other tests.
     22
     23        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
     24        (NPP_Destroy):
     25        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
     26        (webkit_test_plugin_destroy_instance):
     27        Call through to the PluginTest when NPP_Destroy is called.
     28
    1292010-10-26  Brian Weinstein  <bweinstein@apple.com>
    230
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp

    r70265 r70662  
    4949PluginTest::~PluginTest()
    5050{
     51}
     52
     53NPError PluginTest::NPP_Destroy(NPSavedData**)
     54{
     55    return NPERR_NO_ERROR;
    5156}
    5257
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h

    r70265 r70662  
    5656
    5757    // NPP functions.
     58    virtual NPError NPP_Destroy(NPSavedData**);
    5859    virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
    5960    virtual NPError NPP_GetValue(NPPVariable, void* value);
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp

    r70653 r70662  
    3737
    3838private:
     39    virtual NPError NPP_Destroy(NPSavedData**);
    3940    virtual NPError NPP_GetValue(NPPVariable, void* value);
     41
     42    NPP_GetValueProcPtr m_originalNPPGetValuePointer;
    4043};
    4144
     
    4447NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier)
    4548    : PluginTest(npp, identifier)
     49    , m_originalNPPGetValuePointer(pluginFunctions->getvalue)
    4650{
    4751    // Be sneaky and null out the getvalue pointer the browser is holding. This simulates a plugin
     
    5256}
    5357
     58NPError NullNPPGetValuePointer::NPP_Destroy(NPSavedData**)
     59{
     60    // Set the NPP_GetValue pointer back the way it was before we mucked with it so we don't mess
     61    // up future uses of the plugin module.
     62    pluginFunctions->getvalue = m_originalNPPGetValuePointer;
     63    return NPERR_NO_ERROR;
     64}
     65
    5466NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*)
    5567{
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp

    r70653 r70662  
    284284#endif
    285285
     286        obj->pluginTest->NPP_Destroy(save);
     287
    286288        browser->releaseobject(&obj->header);
    287289    }
  • trunk/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp

    r70655 r70662  
    106106
    107107static NPError
    108 webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/)
     108webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** save)
    109109{
    110110    PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
     
    129129        if (obj->onSetWindow)
    130130            free(obj->onSetWindow);
     131
     132        obj->pluginTest->NPP_Destroy(save);
    131133
    132134        browser->releaseobject(&obj->header);
Note: See TracChangeset for help on using the changeset viewer.