Commit cb31a816 authored by robert@webkit.org's avatar robert@webkit.org

2011-05-13 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-13  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-13  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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0100aa66
2011-05-13 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-05 Pavel Podivilov <podivilov@chromium.org>
Reviewed by Yury Semikhatsky.
......@@ -357,8 +357,6 @@ plugins/embed-attributes-style.html
# ---- depends on QuickTime support
plugins/embed-attributes-setting.html
plugins/plugin-initiate-popup-window.html
# ---- to be reviewed
http/tests/plugins/plugin-document-has-focus.html
# [Qt] plugins/keyboard-events.html fails after r72717
# https://bugs.webkit.org/show_bug.cgi?id=50050
......
CONSOLE MESSAGE: line 0: PLUGIN: keyDown 'a'
CONSOLE MESSAGE: line 0: PLUGIN: keyUp 'a'
This tests that a full page plugin gets keyboard focus without the need to first click it.
2011-05-13 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-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by nobody, build fix.
......
......@@ -1142,6 +1142,11 @@ QString DumpRenderTreeSupportQt::layerTreeAsText(QWebFrame* frame)
return coreFrame->layerTreeAsText();
}
void DumpRenderTreeSupportQt::setView(QWebPage* page, QWidget* view)
{
page->d->view = view;
}
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
......
......@@ -107,6 +107,7 @@ public:
static void setCaretBrowsingEnabled(QWebPage* page, bool value);
static void setMediaType(QWebFrame* qframe, const QString& type);
static void setDumpRenderTreeModeEnabled(bool b);
static void setView(QWebPage*, QWidget* view);
static void garbageCollectorCollect();
static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
......
2011-05-13 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):
2011-05-13 Adam Roben <aroben@apple.com>
Exclude the Leopard NRWT bot from the core builder set
......
......@@ -136,6 +136,7 @@ public:
WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
: QWebPage(parent)
, m_webInspector(0)
, m_eventSender(0)
, m_drt(drt)
{
QWebSettings* globalSettings = QWebSettings::globalSettings();
......@@ -169,6 +170,14 @@ WebPage::~WebPage()
delete m_webInspector;
}
EventSender* WebPage::eventSender()
{
if (!m_eventSender)
m_eventSender = new EventSender(this);
return m_eventSender;
}
QWebInspector* WebPage::webInspector()
{
if (!m_webInspector) {
......@@ -464,7 +473,7 @@ DumpRenderTree::DumpRenderTree()
connect(m_controller, SIGNAL(geolocationPermissionSet()), this, SLOT(geolocationPermissionSet()));
connect(m_controller, SIGNAL(done()), this, SLOT(dump()));
m_eventSender = new EventSender(m_page);
m_eventSender = m_page->eventSender();
m_textInputController = new TextInputController(m_page);
m_plainTextController = new PlainTextController(m_page);
m_gcController = new GCController(m_page);
......@@ -775,7 +784,7 @@ void DumpRenderTree::initJSObjects()
QWebFrame *frame = qobject_cast<QWebFrame*>(sender());
Q_ASSERT(frame);
frame->addToJavaScriptWindowObject(QLatin1String("layoutTestController"), m_controller);
frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), m_eventSender);
frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), qobject_cast<WebPage*>(frame->page())->eventSender());
frame->addToJavaScriptWindowObject(QLatin1String("textInputController"), m_textInputController);
frame->addToJavaScriptWindowObject(QLatin1String("GCController"), m_gcController);
frame->addToJavaScriptWindowObject(QLatin1String("plainText"), m_plainTextController);
......@@ -1097,6 +1106,10 @@ QWebPage *DumpRenderTree::createWindow()
QObject* container = new QObject(m_mainView);
// create a QWebPage we want to return
QWebPage* page = static_cast<QWebPage*>(new WebPage(container, this));
// QWebPage::setView() will display the page, so use a minimal version
// that is just enough to allow EventSender to interact with the page's view
DumpRenderTreeSupportQt::setView(page, m_mainView);
// gets cleaned up in closeRemainingWindows()
windows.append(container);
......
......@@ -89,7 +89,6 @@ public:
void resetToConsistentStateBeforeTesting(const QUrl&);
LayoutTestController *layoutTestController() const { return m_controller; }
EventSender *eventSender() const { return m_eventSender; }
TextInputController *textInputController() const { return m_textInputController; }
QString persistentStoragePath() const { return m_persistentStoragePath; }
NetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; }
......@@ -184,6 +183,7 @@ public:
WebPage(QObject* parent, DumpRenderTree*);
virtual ~WebPage();
QWebInspector* webInspector();
EventSender* eventSender();
void closeWebInspector();
QWebPage *createWindow(QWebPage::WebWindowType);
......@@ -216,6 +216,7 @@ private slots:
private:
QWebInspector* m_webInspector;
EventSender* m_eventSender;
QList<QWebFrame*> m_pendingGeolocationRequests;
DumpRenderTree *m_drt;
};
......
......@@ -98,6 +98,10 @@ webkit_test_plugin_new_instance(NPMIMEType mimetype,
obj->testWindowOpen = TRUE;
else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
obj->onSetWindow = strdup(argv[i]);
else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl")) {
browser->setvalue(instance, NPPVpluginWindowBool, false);
obj->testKeyboardFocusForPlugins = TRUE;
}
}
browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
......@@ -163,6 +167,11 @@ webkit_test_plugin_set_window(NPP instance, NPWindow *window)
obj->testWindowOpen = FALSE;
}
if (obj->testKeyboardFocusForPlugins) {
obj->eventLogging = true;
browser->setvalue(instance, NPPVpluginWindowBool, false);
executeScript(obj, "eventSender.keyDown('A');");
}
}
return obj->pluginTest->NPP_SetWindow(instance, window);
......@@ -292,6 +301,11 @@ webkit_test_plugin_handle_event(NPP instance, void* event)
break;
case KeyRelease:
pluginLog(instance, "keyUp '%c'", keyEventToChar(&evt->xkey));
if (obj->testKeyboardFocusForPlugins) {
obj->eventLogging = false;
obj->testKeyboardFocusForPlugins = FALSE;
executeScript(obj, "layoutTestController.notifyDone();");
}
break;
case KeyPress:
pluginLog(instance, "keyDown '%c'", keyEventToChar(&evt->xkey));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment