Changeset 88712 in webkit


Ignore:
Timestamp:
Jun 13, 2011 3:25:34 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-13 Martin Robinson <mrobinson@igalia.com>

Reviewed by Eric Seidel.

[GTK] [Qt] Eliminate duplicate TestNetscapePlugin implementation
https://bugs.webkit.org/show_bug.cgi?id=62385

Remove adjustCursorEvent from platform-specific test expectation for Chromium Linux,
since the TestPlugin no longer prints this event.

  • platform/chromium-linux/plugins/mouse-events-expected.txt: Remove adjustCursorEvent output.

2011-06-13 Martin Robinson <mrobinson@igalia.com>

Reviewed by Eric Seidel.

[GTK] [Qt] Eliminate duplicate TestNetscapePlugin implementation
https://bugs.webkit.org/show_bug.cgi?id=62385

Remove duplicate TestNetscapePlugIn implementation. Having two copies
of this code makes keeping it in sync much more difficult. The files are
almost identical and this change ports the X11 changes to main.cpp.

  • DumpRenderTree/TestNetscapePlugIn/main.cpp: (NPP_New): Do not set the plugin as windowless always. Doing this breaks some results on Qt and this seems to be unnecessary for the moment. (keyEventToChar): Added this helper which converts a X11 keycode into a char. (handleEventX11): Use the handler to properly convert the keycode. Do not print adjustCursorEvent output. The tests currently do not trigger this for Cocoa and thus it should not be in the results. (NPP_GetValue): Properly handle NPPVpluginNeedsXEmbed and make it clearer why the XP_UNIX block is first by guarding against using a null instance.
  • DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: Update source list add the XP_UNIX define for Linux.
  • DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: Removed.
  • GNUmakefile.am: Update source list.
Location:
trunk
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88709 r88712  
     12011-06-13  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [GTK] [Qt] Eliminate duplicate TestNetscapePlugin implementation
     6        https://bugs.webkit.org/show_bug.cgi?id=62385
     7
     8        Remove adjustCursorEvent from platform-specific test expectation for Chromium Linux,
     9        since the TestPlugin no longer prints this event.
     10
     11        * platform/chromium-linux/plugins/mouse-events-expected.txt: Remove adjustCursorEvent output.
     12
    1132011-06-13  Nate Chapin  <japhet@chromium.org>
    214
  • trunk/LayoutTests/platform/chromium-linux/plugins/mouse-events-expected.txt

    r88513 r88712  
    1 CONSOLE MESSAGE: line 17: PLUGIN: adjustCursorEvent
    2 CONSOLE MESSAGE: line 17: PLUGIN: adjustCursorEvent
    31CONSOLE MESSAGE: line 18: PLUGIN: getFocusEvent
    42CONSOLE MESSAGE: line 18: PLUGIN: mouseDown at (12, 12)
    53CONSOLE MESSAGE: line 19: PLUGIN: mouseUp at (12, 12)
    6 CONSOLE MESSAGE: line 20: PLUGIN: adjustCursorEvent
    74CONSOLE MESSAGE: line 21: PLUGIN: mouseDown at (22, 22)
    8 CONSOLE MESSAGE: line 23: PLUGIN: adjustCursorEvent
    95CONSOLE MESSAGE: line 23: PLUGIN: mouseUp at (32, 22)
    10 CONSOLE MESSAGE: line 24: PLUGIN: adjustCursorEvent
    116
    127Test for bug 11517: Flash clicks/interactivity not working properly.
  • trunk/Tools/ChangeLog

    r88680 r88712  
     12011-06-13  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [GTK] [Qt] Eliminate duplicate TestNetscapePlugin implementation
     6        https://bugs.webkit.org/show_bug.cgi?id=62385
     7
     8        Remove duplicate TestNetscapePlugIn implementation. Having two copies
     9        of this code makes keeping it in sync much more difficult. The files are
     10        almost identical and this change ports the X11 changes to main.cpp.
     11
     12        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
     13        (NPP_New): Do not set the plugin as windowless always. Doing this breaks
     14        some results on Qt and this seems to be unnecessary for the moment.
     15        (keyEventToChar): Added this helper which converts a X11 keycode into a char.
     16        (handleEventX11): Use the handler to properly convert the keycode. Do not print
     17        adjustCursorEvent output. The tests currently do not trigger this for Cocoa and thus
     18        it should not be in the results.
     19        (NPP_GetValue): Properly handle NPPVpluginNeedsXEmbed and make it clearer why the
     20        XP_UNIX block is first by guarding against using a null instance.
     21        * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: Update source list add
     22        the XP_UNIX define for Linux.
     23        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: Removed.
     24        * GNUmakefile.am: Update source list.
     25
    1262011-06-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    227
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp

    r88513 r88712  
    2828#include "PluginTest.h"
    2929#include <cstdlib>
     30#include <cstring>
    3031#include <string>
    3132
    3233#ifdef XP_UNIX
    3334#include <X11/Xlib.h>
     35#include <X11/Xutil.h>
    3436#endif
    3537
     
    286288    }
    287289
    288 #ifdef XP_UNIX
    289     // On Unix, plugins only get events if they are windowless.
    290     browser->setvalue(instance, NPPVpluginWindowBool, 0);
    291 #endif
    292 
    293290    if (onNewScript)
    294291        executeScript(obj, onNewScript);
     
    623620
    624621#ifdef XP_UNIX
     622
     623static char keyEventToChar(XKeyEvent* event)
     624{
     625    char c = ' ';
     626    XLookupString(event, &c, sizeof(c), 0, 0);
     627    return c;
     628}
     629
    625630static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event)
    626631{
    627     XButtonPressedEvent* buttonPressEvent = reinterpret_cast<XButtonPressedEvent*>(event);
    628     XButtonReleasedEvent* buttonReleaseEvent = reinterpret_cast<XButtonReleasedEvent*>(event);
    629632    switch (event->type) {
    630633    case ButtonPress:
    631634        if (obj->eventLogging)
    632             pluginLog(instance, "mouseDown at (%d, %d)", buttonPressEvent->x, buttonPressEvent->y);
     635            pluginLog(instance, "mouseDown at (%d, %d)", event->xbutton.x, event->xbutton.y);
    633636        if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
    634637            executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
     
    636639    case ButtonRelease:
    637640        if (obj->eventLogging)
    638             pluginLog(instance, "mouseUp at (%d, %d)", buttonReleaseEvent->x, buttonReleaseEvent->y);
     641            pluginLog(instance, "mouseUp at (%d, %d)", event->xbutton.x, event->xbutton.y);
    639642        break;
    640643    case KeyPress:
    641644        // FIXME: extract key code
    642645        if (obj->eventLogging)
    643             pluginLog(instance, "NOTIMPLEMENTED: keyDown '%c'", ' ');
     646            pluginLog(instance, "keyDown '%c'", keyEventToChar(&event->xkey));
    644647        if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
    645648            executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
     
    648651        // FIXME: extract key code
    649652        if (obj->eventLogging)
    650             pluginLog(instance, "NOTIMPLEMENTED: keyUp '%c'", ' ');
     653            pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey));
    651654        break;
    652655    case GraphicsExpose:
     
    668671    case LeaveNotify:
    669672    case MotionNotify:
    670         if (obj->eventLogging)
    671             pluginLog(instance, "adjustCursorEvent");
    672673        break;
    673674    default:
     
    781782        return NPERR_NO_ERROR;
    782783    }
    783 #endif
    784 
     784    if (variable == NPPVpluginNeedsXEmbed) {
     785        *((NPBool *)value) = TRUE;
     786        return NPERR_NO_ERROR;
     787    }
     788#endif
     789
     790    if (!instance)
     791        return NPERR_GENERIC_ERROR;
    785792    PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
    786793
  • trunk/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro

    r88513 r88712  
    2929          PluginTest.cpp \
    3030          TestObject.cpp \
     31          main.cpp \
    3132          Tests/DocumentOpenInDestroyStream.cpp \
    3233          Tests/EvaluateJSAfterRemovingPluginElement.cpp \
     
    4445
    4546mac {
    46     SOURCES += ../../TestNetscapePlugIn/main.cpp
    4747    OBJECTIVE_SOURCES += PluginObjectMac.mm
    4848    LIBS += -framework Carbon -framework Cocoa -framework QuartzCore
    49 } else {
    50     SOURCES += ../../unix/TestNetscapePlugin/TestNetscapePlugin.cpp
    5149}
    5250
     
    5553!win32:!embedded:!mac:!symbian {
    5654    LIBS += -lX11
     55    DEFINES += XP_UNIX
    5756}
  • trunk/Tools/GNUmakefile.am

    r88631 r88712  
    267267        Tools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h \
    268268        Tools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h \
    269         Tools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp \
    270269        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
    271270        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
     
    286285        Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h \
    287286        Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp \
    288         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h
     287        Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h \
     288        Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
    289289
    290290TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
Note: See TracChangeset for help on using the changeset viewer.