summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 22:18:18 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-12 22:18:18 +0000
commit937e4c7b4b4744353ea2dc6d01749146664e3e76 (patch)
tree65cbce58cbad33d3b380f071f1f29840ed2c0f83 /webkit
parent13a8adfee148682b7f9489e34c428b37f465675d (diff)
downloadchromium_src-937e4c7b4b4744353ea2dc6d01749146664e3e76.zip
chromium_src-937e4c7b4b4744353ea2dc6d01749146664e3e76.tar.gz
chromium_src-937e4c7b4b4744353ea2dc6d01749146664e3e76.tar.bz2
Fix http://code.google.com/p/chromium/issues/detail?id=4270. Test case added.
BUG=4270 Review URL: http://codereview.chromium.org/10620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5310 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/npapi_layout_test_plugin/PluginObject.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
index 99699d0..40a636c 100644
--- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
+++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp
@@ -105,7 +105,8 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
#define ID_TEST_IDENTIFIER_TO_STRING 17
#define ID_TEST_IDENTIFIER_TO_INT 18
#define ID_TEST_POSTURL_FILE 19
-#define NUM_METHOD_IDENTIFIERS 20
+#define ID_TEST_CALLBACK_AND_GET_VALUE 20
+#define NUM_METHOD_IDENTIFIERS 21
static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS];
static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
@@ -129,6 +130,8 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
"testIdentifierToString",
"testIdentifierToInt",
"testPostURLFile",
+ // Chrome bug http://code.google.com/p/chromium/issues/detail?id=4270
+ "testCallbackAndGetValue",
};
static NPUTF8* createCStringFromNPVariant(const NPVariant* variant)
@@ -314,6 +317,19 @@ static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argC
return true;
}
+static bool testCallbackAndGetValue(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ NPP npp = obj->npp;
+ if (!testCallback(obj, args, argCount, result))
+ return false;
+
+ NPObject *global;
+ browser->getvalue(npp, NPNVWindowNPObject, &global);
+
+ VOID_TO_NPVARIANT(*result);
+ return true;
+}
+
static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && NPVARIANT_IS_STRING(args[1])) {
@@ -698,7 +714,10 @@ static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* a
}
return true;
}
+ } else if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_AND_GET_VALUE]) {
+ return testCallbackAndGetValue(plugin, args, argCount, result);
}
+
return false;
}