summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp')
-rw-r--r--WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
index 7175d33..82b1d4d 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
+++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
@@ -88,12 +88,15 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch
for (int i = 0; i < argc; i++)
if (_stricmp(argn[i], "src") == 0)
pluginLog(instance, "src: %s", argv[i]);
- }
+ } else if (_stricmp(argn[i], "testdocumentopenindestroystream") == 0)
+ obj->testDocumentOpenInDestroyStream = TRUE;
+ else if (_stricmp(argn[i], "testwindowopen") == 0)
+ obj->testWindowOpen = TRUE;
}
instance->pdata = obj;
}
-
+
return NPERR_NO_ERROR;
}
@@ -120,6 +123,15 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save)
NPError NPP_SetWindow(NPP instance, NPWindow *window)
{
+ PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+
+ if (obj) {
+ if (obj->testWindowOpen) {
+ testWindowOpen(instance);
+ obj->testWindowOpen = FALSE;
+ }
+ }
+
return NPERR_NO_ERROR;
}
@@ -149,7 +161,7 @@ NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool se
if (obj->onStreamLoad)
executeScript(obj, obj->onStreamLoad);
-
+
return NPERR_NO_ERROR;
}
@@ -160,6 +172,10 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason)
if (obj->onStreamDestroy)
executeScript(obj, obj->onStreamDestroy);
+ if (obj->testDocumentOpenInDestroyStream) {
+ testDocumentOpen(instance);
+ }
+
return NPERR_NO_ERROR;
}