mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Merge
This commit is contained in:
commit
7203024ba1
@ -9781,7 +9781,7 @@ nsHTMLPluginObjElementSH::Call(nsIXPConnectWrappedNative *wrapper,
|
||||
|
||||
// If obj is a native wrapper, or if there's no plugin around for
|
||||
// this object, throw.
|
||||
if (!ObjectIsNativeWrapper(cx, obj) || !pi) {
|
||||
if (ObjectIsNativeWrapper(cx, obj) || !pi) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
@ -125,6 +125,7 @@ Are you executing $objdir/_tests/reftest/runreftest.py?""" \
|
||||
options.xrePath = getFullPath(options.xrePath)
|
||||
|
||||
options.symbolsPath = getFullPath(options.symbolsPath)
|
||||
options.utilityPath = getFullPath(options.utilityPath)
|
||||
|
||||
profileDir = None
|
||||
try:
|
||||
|
@ -51,8 +51,6 @@
|
||||
["Boolean", "false", true],
|
||||
["Boolean", new Boolean(false), true],
|
||||
["Boolean", { "value": false }, true],
|
||||
// Date object
|
||||
// ["Date", "December 17, 1995 03:24:00", Date("December 17, 1995 03:24:00")],
|
||||
// Function object
|
||||
["Function", "return 3", Function("return 3")],
|
||||
["Function", "window.alert('test')", Function("window.alert('test')")],
|
||||
@ -87,6 +85,7 @@
|
||||
function runTests() {
|
||||
var plugin = document.getElementById("plugin1");
|
||||
|
||||
// Test calling NPN_InvokeDefault from within plugin code.
|
||||
for each (var test in tests) {
|
||||
var result = plugin.npnInvokeDefaultTest(test[0], test[1]);
|
||||
// serialize the two values for easy
|
||||
@ -110,7 +109,17 @@
|
||||
BR()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Test calling the invokedefault method of plugin-defined object
|
||||
is(plugin(), "Test Plug-in",
|
||||
"calling NPN_InvokeDefault on plugin-defined Object doesn't work");
|
||||
is(plugin(1), "Test Plug-in;1",
|
||||
"calling NPN_InvokeDefault on plugin-defined Object doesn't work");
|
||||
is(plugin("test"), "Test Plug-in;test",
|
||||
"calling NPN_InvokeDefault on plugin-defined Object doesn't work");
|
||||
is(plugin(undefined, -1, null), "Test Plug-in;undefined;-1;null",
|
||||
"calling NPN_InvokeDefault on plugin-defined Object doesn't work");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
|
@ -47,6 +47,10 @@ with the specified argument. Returns the result of the invocation.
|
||||
If an error has occurred during the last stream or npruntime function,
|
||||
this will return a string error message, otherwise it returns "pass".
|
||||
|
||||
* () - default method
|
||||
Returns a string consisting of the plugin name, concatenated with any
|
||||
arguments passed to the method.
|
||||
|
||||
== Private browsing ==
|
||||
|
||||
The test plugin object supports the following scriptable methods:
|
||||
|
@ -1192,7 +1192,30 @@ scriptableInvoke(NPObject* npobj, NPIdentifier name, const NPVariant* args, uint
|
||||
bool
|
||||
scriptableInvokeDefault(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result)
|
||||
{
|
||||
return false;
|
||||
ostringstream value;
|
||||
value << PLUGIN_NAME;
|
||||
for (uint32_t i = 0; i < argCount; i++) {
|
||||
switch(args[i].type) {
|
||||
case NPVariantType_Int32:
|
||||
value << ";" << NPVARIANT_TO_INT32(args[i]);
|
||||
break;
|
||||
case NPVariantType_String: {
|
||||
const NPString* argstr = &NPVARIANT_TO_STRING(args[i]);
|
||||
value << ";" << argstr->UTF8Characters;
|
||||
break;
|
||||
}
|
||||
case NPVariantType_Void:
|
||||
value << ";undefined";
|
||||
break;
|
||||
case NPVariantType_Null:
|
||||
value << ";null";
|
||||
break;
|
||||
default:
|
||||
value << ";other";
|
||||
}
|
||||
}
|
||||
STRINGZ_TO_NPVARIANT(strdup(value.str().c_str()), *result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user