Commit 87659e2a authored by zecke@webkit.org's avatar zecke@webkit.org
Browse files

[Qt] Add automatic test case for plugins that use QWidget

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

Change the RenderTreeAsText to look into the WebCore::Widget
and print the state of the platformWidget. Change the DRT to
use QtUiTools to be able to initiate QProgressBar and such
as a plugin. Add the test case, add the result, update the
other results due the new test.

WebCore:
* rendering/RenderTreeAsText.cpp:
(WebCore::operator<<): Add special case for RenderPart

WebKitTools:
* DumpRenderTree/qt/DumpRenderTree.cpp:
(WebCore::WebPage::createPlugin):
* DumpRenderTree/qt/DumpRenderTree.h:
* DumpRenderTree/qt/DumpRenderTree.pro:

LayoutTest:
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/plugins/netscape-dom-access-expected.txt: Added
* platform/qt/plugins/qt-qwidget-plugin-expected.txt: Added
* platform/win/Skipped:
* plugins/qt-qwidget-plugin.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ce8bed67
2009-11-21 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Add automatic test for Qt Plugins.
https://bugs.webkit.org/show_bug.cgi?id=31203
Add a test case for Qt plugins. In this case one
RenderPart should be visible on screen and the other
should be invisible. The internal QWidget should
have the same state as the WebCore::Widget.
Add Qt specific netscape-dom-access-expected.txt because
that was using a native widget inside a RenderPart as well.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/plugins/netscape-dom-access-expected.txt: Added
* platform/qt/plugins/qt-qwidget-plugin-expected.txt: Added
* platform/win/Skipped:
* plugins/qt-qwidget-plugin.html: Added.
2009-11-25 Csaba Osztrogonác <ossy@webkit.org>
 
[Qt] Audio related layout tests are failing on the buildbot
......@@ -3624,6 +3624,8 @@ plugins/jsobjc-simple.html
plugins/root-object-premature-delete-crash.html
plugins/throw-on-dealloc.html
plugins/undefined-property-crash.html
# These test require Qt Widgets
plugins/qt-qwidget-plugin.html
# Tests failing
plugins/embed-attributes-setting.html
plugins/get-url-with-blank-target.html
......
......@@ -106,3 +106,5 @@ fast/history/back-forward-reset-after-error-handling.html
plugins/reloadplugins-and-pages.html
plugins/reloadplugins-no-pages.html
# These test require Qt Widgets
plugins/qt-qwidget-plugin.html
......@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
text run at (573,0) width 185: "The plug-in should have a"
text run at (0,20) width 107: "3px red border."
RenderBlock (anonymous) at (0,56) size 784x206
RenderPartObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)]
RenderPartObject {EMBED} at (0,0) size 206x206 [border: (3px solid #FF0000)] [QT: geometry: {at (8,64) size 200x200} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 200x200} ]
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x104
RenderText {#text} at (0,0) size 48x20
text run at (0,0) width 48: "Image:"
RenderBR {BR} at (48,16) size 0x0
RenderImage {IMG} at (0,20) size 80x80
RenderText {#text} at (80,84) size 4x20
text run at (80,84) width 4: " "
RenderBR {BR} at (0,0) size 0x0
RenderBlock {DIV} at (0,104) size 784x34
RenderText {#text} at (0,14) size 123x20
text run at (0,14) width 123: "QT progress bar: "
RenderPartObject {OBJECT} at (123,0) size 300x30 [QT: geometry: {at (131,112) size 300x30} isHidden: 0 isSelfVisible: 1 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
RenderText {#text} at (0,0) size 0x0
RenderBlock {DIV} at (0,138) size 784x34
RenderText {#text} at (0,14) size 174x20
text run at (0,14) width 174: "You should not see this: "
RenderPartObject {OBJECT} at (174,0) size 300x30 [QT: geometry: {at (182,146) size 300x30} isHidden: 1 isSelfVisible: 0 isParentVisible: 1 mask: {at (0,0) size 300x30} ]
RenderText {#text} at (0,0) size 0x0
......@@ -712,3 +712,7 @@ fast/forms/validationMessage.html
# Need to implement this in plugins code in WebKit
plugins/reloadplugins-and-pages.html
plugins/reloadplugins-no-pages.html
# These tests require Qt Widgets
plugins/qt-qwidget-plugin.html
<html>
<body>
Image:<br/>
<img src="qrc:/webkit/inspector/Images/largerResourcesButtonGlyph.png" width="80" height="80"/>
<br/>
<!-- visible progressbar -->
<div>
QT progress bar:
<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar1" height=30></object>
</div>
<!-- should not be visible -->
<div style="visibility: hidden;">
You should not see this:
<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar2" height=30></object>
</div>
</body>
</html>
2009-11-21 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Add Qt specific information of RenderPart
https://bugs.webkit.org/show_bug.cgi?id=31203
The WebCore::Widget of the RenderPart (RenderWidget) might be
backed with a platform widget. Print both the WebCore::Widget
and platform widget state. In the above bug we had a problem
that the WebCore::Widget was invisible but the QWidget was
visible.
* rendering/RenderTreeAsText.cpp:
(WebCore::operator<<): Add special case for RenderPart
2009-11-17 Holger Hans Peter Freyther <zecke@selfish.org>
 
Reviewed by Kenneth Rohde Christiansen.
......@@ -39,6 +39,7 @@
#include "RenderFileUploadControl.h"
#include "RenderInline.h"
#include "RenderListMarker.h"
#include "RenderPart.h"
#include "RenderTableCell.h"
#include "RenderView.h"
#include "RenderWidget.h"
......@@ -56,6 +57,10 @@
#include "SVGRenderTreeAsText.h"
#endif
#if PLATFORM(QT)
#include <QWidget>
#endif
namespace WebCore {
using namespace HTMLNames;
......@@ -340,6 +345,24 @@ static TextStream &operator<<(TextStream& ts, const RenderObject& o)
}
}
#if PLATFORM(QT)
// Print attributes of embedded QWidgets. E.g. when the WebCore::Widget
// is invisible the QWidget should be invisible too.
if (o.isRenderPart()) {
const RenderPart* part = toRenderPart(const_cast<RenderObject*>(&o));
if (part->widget() && part->widget()->platformWidget()) {
QWidget* wid = part->widget()->platformWidget();
ts << " [QT: ";
ts << "geometry: {" << wid->geometry() << "} ";
ts << "isHidden: " << wid->isHidden() << " ";
ts << "isSelfVisible: " << part->widget()->isSelfVisible() << " ";
ts << "isParentVisible: " << part->widget()->isParentVisible() << " ";
ts << "mask: {" << wid->mask().boundingRect() << "} ] ";
}
}
#endif
return ts;
}
......
2009-11-21 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Kenneth Rohde Christiansen.
Link DumpRenderTree to the Qt Ui Tools
https://bugs.webkit.org/show_bug.cgi?id=31203
Implement QWebPage::createPlugin using the Qt Ui Tools
to be able to create classes like QProgressBar from within
the <object></object> tags This is required for the
new automatic test of Qt Plugins.
* DumpRenderTree/qt/DumpRenderTree.cpp:
(WebCore::WebPage::createPlugin):
* DumpRenderTree/qt/DumpRenderTree.h:
* DumpRenderTree/qt/DumpRenderTree.pro:
2009-11-25 Yuzo Fujishima <yuzo@google.com>
Reviewed by Eric Seidel.
......
......@@ -60,6 +60,10 @@
#include <qwebsettings.h>
#include <qwebsecurityorigin.h>
#ifndef QT_NO_UITOOLS
#include <QtUiTools/QUiLoader>
#endif
#ifdef Q_WS_X11
#include <fontconfig/fontconfig.h>
#endif
......@@ -270,6 +274,20 @@ bool WebPage::extension(Extension extension, const ExtensionOption *option, Exte
return true;
}
QObject* WebPage::createPlugin(const QString& classId, const QUrl& url, const QStringList& paramNames, const QStringList& paramValues)
{
Q_UNUSED(url);
Q_UNUSED(paramNames);
Q_UNUSED(paramValues);
#ifndef QT_NO_UITOOLS
QUiLoader loader;
return loader.createWidget(classId, view());
#else
Q_UNUSED(classId);
return 0;
#endif
}
DumpRenderTree::DumpRenderTree()
: m_dumpPixels(false)
, m_stdin(0)
......
......@@ -154,6 +154,8 @@ public:
virtual bool supportsExtension(QWebPage::Extension extension) const;
virtual bool extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output);
QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&);
public slots:
bool shouldInterruptJavaScript() { return false; }
......
TARGET = DumpRenderTree
CONFIG -= app_bundle
CONFIG += uitools
mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
CONFIG -= debug
......
Supports Markdown
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