diff options
Diffstat (limited to 'Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp')
-rw-r--r-- | Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp index 6a7303f13..85cd41d2c 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp @@ -41,17 +41,10 @@ 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) -#endif +} while(false) static bool getEntryPointsWasCalled; static bool initializeWasCalled; @@ -123,7 +116,6 @@ 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; @@ -356,30 +348,29 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - if (!obj) - return NPERR_GENERIC_ERROR; - - obj->lastWindow = *window; + if (obj) { + obj->lastWindow = *window; - if (obj->logSetWindow) { - pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); - obj->logSetWindow = FALSE; - executeScript(obj, "testRunner.notifyDone();"); - } + if (obj->logSetWindow) { + pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height); + obj->logSetWindow = FALSE; + executeScript(obj, "testRunner.notifyDone();"); + } - if (obj->onSetWindow) - executeScript(obj, obj->onSetWindow); + if (obj->onSetWindow) + executeScript(obj, obj->onSetWindow); - if (obj->testWindowOpen) { - testWindowOpen(instance); - obj->testWindowOpen = FALSE; - } + if (obj->testWindowOpen) { + testWindowOpen(instance); + obj->testWindowOpen = FALSE; + } - if (obj->testKeyboardFocusForPlugins) { - obj->eventLogging = true; - executeScript(obj, "eventSender.keyDown('A');"); + if (obj->testKeyboardFocusForPlugins) { + obj->eventLogging = true; + executeScript(obj, "eventSender.keyDown('A');"); + } } - + return obj->pluginTest->NPP_SetWindow(window); } @@ -808,12 +799,6 @@ 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 |