Changeset 88471 in webkit


Ignore:
Timestamp:
Jun 9, 2011 12:30:55 PM (13 years ago)
Author:
Martin Robinson
Message:

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

Reviewed by Andreas Kling.

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

Remove a cr-linux expectation that no longer differs from the default
expectation.

  • platform/chromium-linux/plugins/mouse-events-expected.txt: Removed.

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

Reviewed by Andreas Kling.

[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: (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.
  • DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: Update source list.
  • DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: Removed.
  • GNUmakefile.am: Update source list.
Location:
trunk
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88468 r88471  
     12011-06-09  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [GTK] [Qt] Eliminate duplicate TestNetscapePlugin implementation
     6        https://bugs.webkit.org/show_bug.cgi?id=62385
     7
     8        Remove a cr-linux expectation that no longer differs from the default
     9        expectation.
     10
     11        * platform/chromium-linux/plugins/mouse-events-expected.txt: Removed.
     12
    1132011-06-02  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Tools/ChangeLog

    r88465 r88471  
     12011-06-09  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Andreas Kling.
     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        (keyEventToChar): Added this helper which converts a X11 keycode into a char.
     14        (handleEventX11): Use the handler to properly convert the keycode. Do not print
     15        adjustCursorEvent output. The tests currently do not trigger this for Cocoa and thus
     16        it should not be in the results.
     17        (NPP_GetValue): Properly handle NPPVpluginNeedsXEmbed.
     18        * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: Update source list.
     19        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: Removed.
     20        * GNUmakefile.am: Update source list.
     21
    1222011-06-09  Noel Gordon  <noel.gordon@gmail.com>
    223
  • trunk/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp

    r88465 r88471  
    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
     
    623625
    624626#ifdef XP_UNIX
     627
     628static char keyEventToChar(XKeyEvent* event)
     629{
     630    char c = ' ';
     631    XLookupString(event, &c, sizeof(c), 0, 0);
     632    return c;
     633}
     634
    625635static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event)
    626636{
    627     XButtonPressedEvent* buttonPressEvent = reinterpret_cast<XButtonPressedEvent*>(event);
    628     XButtonReleasedEvent* buttonReleaseEvent = reinterpret_cast<XButtonReleasedEvent*>(event);
    629637    switch (event->type) {
    630638    case ButtonPress:
    631639        if (obj->eventLogging)
    632             pluginLog(instance, "mouseDown at (%d, %d)", buttonPressEvent->x, buttonPressEvent->y);
     640            pluginLog(instance, "mouseDown at (%d, %d)", event->xbutton.x, event->xbutton.y);
    633641        if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
    634642            executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
     
    636644    case ButtonRelease:
    637645        if (obj->eventLogging)
    638             pluginLog(instance, "mouseUp at (%d, %d)", buttonReleaseEvent->x, buttonReleaseEvent->y);
     646            pluginLog(instance, "mouseUp at (%d, %d)", event->xbutton.x, event->xbutton.y);
    639647        break;
    640648    case KeyPress:
    641649        // FIXME: extract key code
    642650        if (obj->eventLogging)
    643             pluginLog(instance, "NOTIMPLEMENTED: keyDown '%c'", ' ');
     651            pluginLog(instance, "keyDown '%c'", keyEventToChar(&event->xkey));
    644652        if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
    645653            executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
     
    648656        // FIXME: extract key code
    649657        if (obj->eventLogging)
    650             pluginLog(instance, "NOTIMPLEMENTED: keyUp '%c'", ' ');
     658            pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey));
    651659        break;
    652660    case GraphicsExpose:
     
    668676    case LeaveNotify:
    669677    case MotionNotify:
    670         if (obj->eventLogging)
    671             pluginLog(instance, "adjustCursorEvent");
    672678        break;
    673679    default:
     
    781787        return NPERR_NO_ERROR;
    782788    }
     789    if (variable == NPPVpluginNeedsXEmbed) {
     790        *((NPBool *)value) = TRUE;
     791        return NPERR_NO_ERROR;
     792    }
    783793#endif
    784794
  • trunk/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro

    r86487 r88471  
    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
  • trunk/Tools/GNUmakefile.am

    r88185 r88471  
    217217        Tools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h \
    218218        Tools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h \
    219         Tools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp \
    220219        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
    221220        Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
     
    236235        Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h \
    237236        Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp \
    238         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h
     237        Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h \
     238        Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
    239239
    240240TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
Note: See TracChangeset for help on using the changeset viewer.