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

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

Issue 393017: This CL fixes the document-open.html and window-open.html plugin layout tests... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/npapi_layout_test_plugin/PluginObject.cpp ('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
===================================================================
--- webkit/tools/npapi_layout_test_plugin/main.cpp (revision 31913)
+++ webkit/tools/npapi_layout_test_plugin/main.cpp (working copy)
@@ -53,46 +53,6 @@
#include <X11/Xlib.h>
#endif
-static void log(NPP instance, const char* format, ...)
-{
- va_list args;
- va_start(args, format);
- char message[2048] = "PLUGIN: ";
- vsprintf(message + strlen(message), format, args);
- va_end(args);
-
- NPObject* windowObject = 0;
- NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject);
- if (error != NPERR_NO_ERROR) {
- fprintf(stderr, "Failed to retrieve window object while logging: %s\n", message);
- return;
- }
-
- NPVariant consoleVariant;
- if (!browser->getproperty(instance, windowObject, browser->getstringidentifier("console"), &consoleVariant)) {
- fprintf(stderr, "Failed to retrieve console object while logging: %s\n", message);
- browser->releaseobject(windowObject);
- return;
- }
-
- NPObject* consoleObject = NPVARIANT_TO_OBJECT(consoleVariant);
-
- NPVariant messageVariant;
- STRINGZ_TO_NPVARIANT(message, messageVariant);
-
- NPVariant result;
- if (!browser->invoke(instance, consoleObject, browser->getstringidentifier("log"), &messageVariant, 1, &result)) {
- fprintf(stderr, "Failed to invoke console.log while logging: %s\n", message);
- browser->releaseobject(consoleObject);
- browser->releaseobject(windowObject);
- return;
- }
-
- browser->releasevariantvalue(&result);
- browser->releaseobject(consoleObject);
- browser->releaseobject(windowObject);
-}
-
// Plugin entry points
extern "C" {
EXPORT NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
@@ -174,8 +134,13 @@
fflush(stdout);
}
}
- } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0)
+ } else if (strcasecmp(argn[i], "cleardocumentduringnew") == 0) {
executeScript(obj, "document.body.innerHTML = ''");
+ } else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0) {
+ obj->testDocumentOpenInDestroyStream = TRUE;
+ } else if (strcasecmp(argn[i], "testwindowopen") == 0) {
+ obj->testWindowOpen = TRUE;
+ }
}
instance->pdata = obj;
@@ -219,6 +184,11 @@
fflush(stdout);
obj->logSetWindow = false;
}
+
+ if (obj->testWindowOpen) {
+ testWindowOpen(instance);
+ obj->testWindowOpen = FALSE;
+ }
}
return NPERR_NO_ERROR;
@@ -264,6 +234,11 @@
if (obj->onStreamDestroy)
executeScript(obj, obj->onStreamDestroy);
+ if (obj->testDocumentOpenInDestroyStream) {
+ testDocumentOpen(instance);
+ obj->testDocumentOpenInDestroyStream = FALSE;
+ }
+
return NPERR_NO_ERROR;
}
« no previous file with comments | « webkit/tools/npapi_layout_test_plugin/PluginObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698