diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp')
-rw-r--r-- | Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp index 85cd41d2c..ca9cec8ef 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp @@ -41,10 +41,17 @@ extern "C" void GlobalToLocal(Point*); using namespace std; +#if defined(__GNUC__) +#define CRASH() do { \ + *(int *)(uintptr_t)0xbbadbeef = 0; \ + __builtin_trap(); /* More reliable, but doesn't say BBADBEEF. */ \ +} while (false) +#else #define CRASH() do { \ *(int *)(uintptr_t)0xbbadbeef = 0; \ ((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \ -} while(false) +} while (false) +#endif static bool getEntryPointsWasCalled; static bool initializeWasCalled; @@ -116,6 +123,7 @@ NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) pluginFuncs->print = NPP_Print; pluginFuncs->event = NPP_HandleEvent; pluginFuncs->urlnotify = NPP_URLNotify; + pluginFuncs->urlredirectnotify = NPP_URLRedirectNotify; pluginFuncs->getvalue = NPP_GetValue; pluginFuncs->setvalue = NPP_SetValue; @@ -256,6 +264,8 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc #endif } else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl")) obj->testKeyboardFocusForPlugins = TRUE; + else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-alert-and-notify-done.pl")) + executeScript(obj, "alert('Plugin Loaded!'); testRunner.notifyDone();"); else if (!strcasecmp(argn[i], "evaluatescript")) { char* script = argv[i]; if (script == strstr(script, "mouse::")) { @@ -348,29 +358,30 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - if (obj) { - obj->lastWindow = *window; + if (!obj) + return NPERR_GENERIC_ERROR; - if (obj->logSetWindow) { - pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); - obj->logSetWindow = FALSE; - executeScript(obj, "testRunner.notifyDone();"); - } + obj->lastWindow = *window; - if (obj->onSetWindow) - executeScript(obj, obj->onSetWindow); + if (obj->logSetWindow) { + pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); + obj->logSetWindow = FALSE; + executeScript(obj, "testRunner.notifyDone();"); + } - if (obj->testWindowOpen) { - testWindowOpen(instance); - obj->testWindowOpen = FALSE; - } + if (obj->onSetWindow) + executeScript(obj, obj->onSetWindow); - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = true; - executeScript(obj, "eventSender.keyDown('A');"); - } + if (obj->testWindowOpen) { + testWindowOpen(instance); + obj->testWindowOpen = FALSE; } - + + if (obj->testKeyboardFocusForPlugins) { + obj->eventLogging = true; + executeScript(obj, "eventSender.keyDown('A');"); + } + return obj->pluginTest->NPP_SetWindow(window); } @@ -799,6 +810,12 @@ void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyD handleCallback(obj, url, reason, notifyData); } +void NPP_URLRedirectNotify(NPP instance, const char *url, int32_t status, void *notifyData) +{ + PluginObject* obj = static_cast<PluginObject*>(instance->pdata); + obj->pluginTest->NPP_URLRedirectNotify(url, status, notifyData); +} + NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) { #ifdef XP_UNIX |