diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp index 966ed2f..198d3c5 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp @@ -141,6 +141,7 @@ enum { ID_PROPERTY_THROW_EXCEPTION_PROPERTY, ID_LAST_SET_WINDOW_ARGUMENTS, ID_PROPERTY_WINDOWED_PLUGIN, + ID_PROPERTY_TEST_OBJECT_COUNT, NUM_PROPERTY_IDENTIFIERS }; @@ -157,7 +158,8 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { "cachedPrivateBrowsingEnabled", "testThrowExceptionProperty", "lastSetWindowArguments", - "windowedPlugin" + "windowedPlugin", + "testObjectCount", }; enum { @@ -184,6 +186,7 @@ enum { ID_TEST_FAIL_METHOD, ID_TEST_CLONE_OBJECT, ID_TEST_SCRIPT_OBJECT_INVOKE, + ID_TEST_CREATE_TEST_OBJECT, ID_DESTROY_NULL_STREAM, ID_TEST_RELOAD_PLUGINS_NO_PAGES, ID_TEST_RELOAD_PLUGINS_AND_PAGES, @@ -224,6 +227,7 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { "testFail", "testCloneObject", "testScriptObjectInvoke", + "testCreateTestObject", "destroyNullStream", "reloadPluginsNoPages", "reloadPluginsAndPages", @@ -327,6 +331,10 @@ static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* resul STRINGZ_TO_NPVARIANT(buf, *result); return true; } + if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT_COUNT]) { + INT32_TO_NPVARIANT(getTestObjectCount(), *result); + return true; + } return false; } @@ -836,6 +844,9 @@ static bool testScriptObjectInvoke(PluginObject* obj, const NPVariant* args, uin browser->releasevariantvalue(&object_method_result); VOID_TO_NPVARIANT(*result); } + + browser->releaseobject(object_arg); + return true; } @@ -1035,6 +1046,12 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a OBJECT_TO_NPVARIANT(new_object, *result); return true; } + if (name == pluginMethodIdentifiers[ID_TEST_CREATE_TEST_OBJECT]) { + NPObject* testObject = browser->createobject(plugin->npp, getTestClass()); + assert(testObject->referenceCount == 1); + OBJECT_TO_NPVARIANT(testObject, *result); + return true; + } if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM]) return destroyNullStream(plugin, args, argCount, result); if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) { |