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

Unified Diff: webkit/tools/npapi_layout_test_plugin/main.cpp

Issue 150144: linux: make layout test plugin build and run in test_shell (Closed)
Patch Set: Created 11 years, 6 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
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/npapi_layout_test_plugin/main.cpp
diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp
index fcd21fd41b1576e3c242fc4d7212857c7db4b7c1..0457ec4a71b54227f3df97c5b50c92aa960dee3f 100644
--- a/webkit/tools/npapi_layout_test_plugin/main.cpp
+++ b/webkit/tools/npapi_layout_test_plugin/main.cpp
@@ -90,18 +90,35 @@ static void log(NPP instance, const char* format, ...)
browser->releaseobject(windowObject);
}
-// Mach-o entry points
+// Plugin entry points
extern "C" {
- NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs);
+ NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
+#if defined(OS_LINUX)
+ , NPPluginFuncs *pluginFuncs
+#endif
+ );
NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
void NPAPI NP_Shutdown(void);
+
+#if defined(OS_LINUX)
+ NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
+ const char* NP_GetMIMEDescription(void);
+#endif
}
-// Mach-o entry points
-NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs)
+// Plugin entry points
+NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
+#if defined(OS_LINUX)
+ , NPPluginFuncs *pluginFuncs
+#endif
+)
{
browser = browserFuncs;
+#if defined(OS_LINUX)
+ return NP_GetEntryPoints(pluginFuncs);
+#else
return NPERR_NO_ERROR;
+#endif
}
NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
@@ -429,18 +446,49 @@ void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyD
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
- if (variable == NPPVpluginScriptableNPObject) {
- void **v = (void **)value;
- PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
- // Return value is expected to be retained
- browser->retainobject((NPObject *)obj);
- *v = obj;
- return NPERR_NO_ERROR;
+ NPError err = NPERR_NO_ERROR;
+
+ switch (variable) {
+#if defined(OS_LINUX)
+ case NPPVpluginNameString:
+ *((const char **)value) = "WebKit Test PlugIn";
+ break;
+ case NPPVpluginDescriptionString:
+ *((const char **)value) = "Simple Netscape plug-in that handles test content for WebKit";
+ break;
+ case NPPVpluginNeedsXEmbed:
+ *((NPBool *)value) = TRUE;
+ break;
+#endif
+ case NPPVpluginScriptableNPObject: {
+ void **v = (void **)value;
+ PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+ // Return value is expected to be retained
+ browser->retainobject((NPObject *)obj);
+ *v = obj;
+ break;
+ }
+ default:
+ fprintf(stderr, "Unhandled variable to NPP_GetValue\n");
+ err = NPERR_GENERIC_ERROR;
+ break;
}
- return NPERR_GENERIC_ERROR;
+
+ return err;
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
{
return NPERR_GENERIC_ERROR;
}
+
+#if defined(OS_LINUX)
+NPError NP_GetValue(NPP instance, NPPVariable variable, void *value)
+{
+ return NPP_GetValue(instance, variable, value);
+}
+
+const char* NP_GetMIMEDescription(void) {
+ return "application/x-webkit-test-netscape:testnetscape:test netscape content";
+}
+#endif
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698