Changeset 86504 in webkit


Ignore:
Timestamp:
May 15, 2011 6:49:23 AM (13 years ago)
Author:
robert@webkit.org
Message:

2011-05-12 Robert Hogan <robert@webkit.org>

Reviewed by Benjamin Poulain.

[Qt] fix http/tests/plugins/plugin-document-has-focus.html

For some reason the platform-independent expected result has
no newline at the end of the file. The unix test plugin also
reports the event from a different line. These are harmless
differences, so create platform-specific result.

Note that nearly every platform skips this test at the moment.

https://bugs.webkit.org/show_bug.cgi?id=60722

  • platform/qt/Skipped:
  • platform/qt/http/tests/plugins/plugin-document-has-focus-expected.txt: Added.

2011-05-12 Robert Hogan <robert@webkit.org>

Reviewed by Benjamin Poulain.

[Qt] fix http/tests/plugins/plugin-document-has-focus.html
https://bugs.webkit.org/show_bug.cgi?id=60722

QWebPage::setView() will display the browser window, so
implement a private version that does just enough to
satisfy EventSender's requirement to install an event
filter on a page's web view.

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp: (DumpRenderTreeSupportQt::setView):
  • WebCoreSupport/DumpRenderTreeSupportQt.h:

2011-05-12 Robert Hogan <robert@webkit.org>

Reviewed by Benjamin Poulain.

[Qt] fix http/tests/plugins/plugin-document-has-focus.html

The support for this test added to the unix test plugin here
may allow other platforms to pass it (nearly everyone
skips it). On Qt it required a bit of trickiness with
the page's EventSender object to get it working fully though,
so only unskipping Qt here.

https://bugs.webkit.org/show_bug.cgi?id=60722

  • DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebCore::WebPage::WebPage): (WebCore::WebPage::eventSender): (WebCore::DumpRenderTree::DumpRenderTree): (WebCore::DumpRenderTree::initJSObjects): (WebCore::DumpRenderTree::createWindow):
  • DumpRenderTree/qt/DumpRenderTreeQt.h:
  • DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp: (webkit_test_plugin_new_instance): (webkit_test_plugin_set_window): (webkit_test_plugin_handle_event):
Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86500 r86504  
     12011-05-12  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Benjamin Poulain.
     4
     5        [Qt] fix http/tests/plugins/plugin-document-has-focus.html
     6
     7        For some reason the platform-independent expected result has
     8        no newline at the end of the file. The unix test plugin also
     9        reports the event from a different line. These are harmless
     10        differences, so create platform-specific result.
     11
     12        Note that nearly every platform skips this test at the moment.
     13
     14        https://bugs.webkit.org/show_bug.cgi?id=60722
     15
     16        * platform/qt/Skipped:
     17        * platform/qt/http/tests/plugins/plugin-document-has-focus-expected.txt: Added.
     18
    1192011-05-14  Abhishek Arya  <inferno@chromium.org>
    220
  • trunk/LayoutTests/platform/qt/Skipped

    r86490 r86504  
    358358plugins/embed-attributes-setting.html
    359359plugins/plugin-initiate-popup-window.html
    360 # ---- to be reviewed
    361 http/tests/plugins/plugin-document-has-focus.html
    362360
    363361# Crashes on the buildbot.
  • trunk/Source/WebKit/qt/ChangeLog

    r86464 r86504  
     12011-05-12  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Benjamin Poulain.
     4
     5        [Qt] fix http/tests/plugins/plugin-document-has-focus.html
     6        https://bugs.webkit.org/show_bug.cgi?id=60722
     7
     8        QWebPage::setView() will display the browser window, so
     9        implement a private version that does just enough to
     10        satisfy EventSender's requirement to install an event
     11        filter on a page's web view.
     12
     13        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     14        (DumpRenderTreeSupportQt::setView):
     15        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     16
    1172011-05-13  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r86464 r86504  
    11431143}
    11441144
     1145void DumpRenderTreeSupportQt::setView(QWebPage* page, QWidget* view)
     1146{
     1147    if (page->view() == view)
     1148        return;
     1149
     1150    page->d->view = view;
     1151    page->setViewportSize(view ? view->size() : QSize(0, 0));
     1152}
     1153
    11451154// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
    11461155
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r86464 r86504  
    108108    static void setMediaType(QWebFrame* qframe, const QString& type);
    109109    static void setDumpRenderTreeModeEnabled(bool b);
     110    static void setView(QWebPage*, QWidget* view);
    110111
    111112    static void garbageCollectorCollect();
  • trunk/Tools/ChangeLog

    r86493 r86504  
     12011-05-12  Robert Hogan  <robert@webkit.org>
     2
     3        Reviewed by Benjamin Poulain.
     4
     5        [Qt] fix http/tests/plugins/plugin-document-has-focus.html
     6
     7        The support for this test added to the unix test plugin here
     8        may allow other platforms to pass it (nearly everyone
     9        skips it). On Qt it required a bit of trickiness with
     10        the page's EventSender object to get it working fully though,
     11        so only unskipping Qt here.
     12
     13        https://bugs.webkit.org/show_bug.cgi?id=60722
     14
     15        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     16        (WebCore::WebPage::WebPage):
     17        (WebCore::WebPage::eventSender):
     18        (WebCore::DumpRenderTree::DumpRenderTree):
     19        (WebCore::DumpRenderTree::initJSObjects):
     20        (WebCore::DumpRenderTree::createWindow):
     21        * DumpRenderTree/qt/DumpRenderTreeQt.h:
     22        * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
     23        (webkit_test_plugin_new_instance):
     24        (webkit_test_plugin_set_window):
     25        (webkit_test_plugin_handle_event):
     26
    1272011-05-14  Arno Renevier  <arno@renevier.net>
    228
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r86464 r86504  
    160160    setNetworkAccessManager(m_drt->networkAccessManager());
    161161    setPluginFactory(new TestPlugin(this));
     162    // Use a minimal, private version of QWebPage::setView() that does not set
     163    // a PageClient widget. We do this so that EventSender can install event filters
     164    // on the page without displaying it.
     165    DumpRenderTreeSupportQt::setView(this, new QWidget(qobject_cast<QWidget*>(parent)));
     166    m_eventSender.reset(new EventSender(this));
    162167
    163168    connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature)));
     
    465470
    466471    connect(m_controller, SIGNAL(done()), this, SLOT(dump()));
    467     m_eventSender = new EventSender(m_page);
    468472    m_textInputController = new TextInputController(m_page);
    469473    m_plainTextController = new PlainTextController(m_page);
     
    551555
    552556    // reset mouse clicks counter
    553     m_eventSender->resetClickCount();
     557    m_page->eventSender()->resetClickCount();
    554558
    555559    closeRemainingWindows();
     
    776780    Q_ASSERT(frame);
    777781    frame->addToJavaScriptWindowObject(QLatin1String("layoutTestController"), m_controller);
    778     frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), m_eventSender);
     782    frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), qobject_cast<WebPage*>(frame->page())->eventSender());
    779783    frame->addToJavaScriptWindowObject(QLatin1String("textInputController"), m_textInputController);
    780784    frame->addToJavaScriptWindowObject(QLatin1String("GCController"), m_gcController);
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h

    r86464 r86504  
    9090
    9191    LayoutTestController *layoutTestController() const { return m_controller; }
    92     EventSender *eventSender() const { return m_eventSender; }
    9392    TextInputController *textInputController() const { return m_textInputController; }
    9493    QString persistentStoragePath() const { return m_persistentStoragePath; }
     
    151150    QWidget* m_mainView;
    152151
    153     EventSender *m_eventSender;
    154152    TextInputController *m_textInputController;
    155153    GCController* m_gcController;
     
    185183    virtual ~WebPage();
    186184    QWebInspector* webInspector();
     185    EventSender* eventSender() { return m_eventSender.data(); }
    187186    void closeWebInspector();
    188187
     
    217216private:
    218217    QWebInspector* m_webInspector;
     218    QScopedPointer<EventSender> m_eventSender;
    219219    QList<QWebFrame*> m_pendingGeolocationRequests;
    220220    DumpRenderTree *m_drt;
  • trunk/Tools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp

    r86464 r86504  
    9999            else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
    100100                obj->onSetWindow = strdup(argv[i]);
     101            else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl")) {
     102                browser->setvalue(instance, NPPVpluginWindowBool, false);
     103                obj->testKeyboardFocusForPlugins = TRUE;
     104            }
    101105        }
    102106
     
    164168        }
    165169
     170        if (obj->testKeyboardFocusForPlugins) {
     171            obj->eventLogging = true;
     172            browser->setvalue(instance, NPPVpluginWindowBool, false);
     173            executeScript(obj, "eventSender.keyDown('A');");
     174        }
    166175    }
    167176
     
    293302        case KeyRelease:
    294303            pluginLog(instance, "keyUp '%c'", keyEventToChar(&evt->xkey));
     304            if (obj->testKeyboardFocusForPlugins) {
     305                obj->eventLogging = false;
     306                obj->testKeyboardFocusForPlugins = FALSE;
     307                executeScript(obj, "layoutTestController.notifyDone();");
     308            }
    295309            break;
    296310        case KeyPress:
Note: See TracChangeset for help on using the changeset viewer.