Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: webkit/glue/plugins/test/plugin_windowed_test.cc

Issue 258026: Fix scripting during NPP_Destroy. Note that if the plugin is making a call t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/plugins/test/plugin_windowed_test.cc
===================================================================
--- webkit/glue/plugins/test/plugin_windowed_test.cc (revision 28004)
+++ webkit/glue/plugins/test/plugin_windowed_test.cc (working copy)
@@ -64,6 +64,37 @@
return NPERR_NO_ERROR;
}
+NPError WindowedPluginTest::Destroy() {
+ if (test_name() != "ensure_scripting_works_in_destroy")
+ return NPERR_NO_ERROR;
+
+ // Bug 23706: ensure that scripting works with no asserts.
+ NPObject *window_obj = NULL;
+ HostFunctions()->getvalue(id(), NPNVWindowNPObject,&window_obj);
+
+ if (!window_obj) {
+ SetError("Failed to get NPObject for plugin instance");
+ } else {
+ std::string script = "javascript:GetMagicNumber()";
+ NPString script_string;
+ script_string.UTF8Characters = script.c_str();
+ script_string.UTF8Length =
+ static_cast<unsigned int>(script.length());
+
+ NPVariant result_var;
+ bool result = HostFunctions()->evaluate(
+ id(), window_obj, &script_string, &result_var);
+ if (!result ||
+ result_var.type != NPVariantType_Int32 ||
+ result_var.value.intValue != 42) {
+ SetError("Failed to script during NPP_Destroy");
+ }
+ }
+
+ SignalTestCompleted();
+ return NPERR_NO_ERROR;
+}
+
void WindowedPluginTest::CallJSFunction(
WindowedPluginTest* this_ptr, const char* function) {
NPIdentifier function_id = this_ptr->HostFunctions()->getstringidentifier(
Property changes on: webkit\glue\plugins\test\plugin_windowed_test.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« webkit/glue/plugins/test/plugin_test.cc ('K') | « webkit/glue/plugins/test/plugin_windowed_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698