summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-04-28 10:36:27 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-04-28 10:36:27 (GMT)
commitb7496ee877e3c0eef51ba982bf7acff082e1d5a1 (patch)
tree461b16a25d4c903a9a1a184570ca183faae0967a /src/3rdparty/webkit/WebKit/qt/tests
parenta17339e943f21bb6c6e16884f716dd9ab8f94938 (diff)
downloadQt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.zip
Qt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.tar.gz
Qt-b7496ee877e3c0eef51ba982bf7acff082e1d5a1.tar.bz2
Updated WebKit to 862268aeb7150d3795d05bfc05f661bb5c598a27
Integrated bugfixes: || <https://webkit.org/b/33280> || [RVCT] ACID3 test crash || || <https://webkit.org/b/37635> || Spatial Navigation: make hasOffscreenRect() to earlier return 'true' if absoluteClippedOverflowRect() gives an empty rect || || <https://webkit.org/b/37637> || Repaint of fixed, transformed element is broken || || <https://webkit.org/b/37313> || [Qt] Fix or remove the runtime flag for accelerated compositing. || || <https://webkit.org/b/36365> || [Qt] [Performance] GraphicsLayer: constructing the layers takes too long || || <https://webkit.org/b/37135> || Spatial Navigation: bail out as soon as algorithm finds a focus candidate is not applicable || || <https://webkit.org/b/38062> || [Qt] HTTP pipelining efficiency increase || || <https://webkit.org/b/35607> || Allow building smoothly on win32 and win64 using GCC || || <https://webkit.org/b/37530> || No default selection for <select multiple> menu lists. || || <https://webkit.org/b/37152> || [Qt] Rendering artifacts on Qt plugins when scrolling the page || || <https://webkit.org/b/36773> || Spatial Navigation: proper handle negative x or y coordinates || || <https://webkit.org/b/34729> || [Qt] Exposing an QVariantMap containing QObjectStar to Javascript causes Segmentation Fault || || <https://webkit.org/b/34730> || [Qt] Null QObjects properties cause Segmentation Fault || || <https://webkit.org/b/37163> || [Qt] inputMethodQuery returns coordinates in web page coordinates rather than in item coordinates. || || <https://webkit.org/b/37934> || [Qt] QtLauncher: make FPS measurement accurate || || <https://webkit.org/b/36783> || Update of fixed elements is not made correctly when the page has been scrolled || || <https://webkit.org/b/37683> || [Qt] WebCore::Font::font() causes a QFont detach || || <https://webkit.org/b/36532> || [Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac || || <https://webkit.org/b/37303> || [Qt] Application crash on exit if NPPlugin is loaded || || <https://webkit.org/b/37816> || [Qt] Multitouch mocking in QtLauncher doesn't work with QGraphicsView || || <https://webkit.org/b/38111> || [Qt] Fix compilation against Qt 4.7 || || <https://webkit.org/b/37821> || [Qt] loads APP directory when calling "window.open" || || <https://webkit.org/b/35393> || [Qt] GraphicsLayer: performance optimizations || || <https://webkit.org/b/32196> || Make it possible to distinguish between NPAPI plugins and Application plugins || || <https://webkit.org/b/37319> || [Qt] tst_QWebFrame::overloadedSlots() fails || || <https://webkit.org/b/34888> || Mac OS X: Use deployment target to determine whether memory tagging should be enabled || || <https://webkit.org/b/36621> || Fix build if NPAPI support is disabled || || <https://webkit.org/b/37461> || Spatial Navigation: make renderRectRelativeToRootDocument method to fallback to getRect() of Element when needed || || <https://webkit.org/b/37719> || Some HTML5 Input tags not treated as needing an input method. || || <https://webkit.org/b/36312> || Support viewport meta tag || || <https://webkit.org/b/36751> || [Qt] Windows CE build is broken || || <https://webkit.org/b/37980> || Fix the build on MSVC 64bit || || <https://webkit.org/b/37727> || [Qt] Webkit fixes for RVCT4 || || <https://webkit.org/b/36832> || [Qt] crash in debug mode just before exit || || <https://webkit.org/b/37867> || [Qt] Patches to upstream from Qt for 2.0 || || <https://webkit.org/b/37615> || Changing view mode names due to specification changes || || <https://webkit.org/b/36853> || REGRESSION(r56552): Broken scrollbars size || || <https://webkit.org/b/36216> || [Qt] GraphicsLayer: support fill-modes || || <https://webkit.org/b/36859> || [Qt]QtLauncher crash on page with CSS 3D transform || || <https://webkit.org/b/37802> || Spatial Navigation: at @updateFocusCandidateIfCloser make an assignment shortcut when FocusCandidate is null ||
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp35
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp60
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp26
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pri1
17 files changed, 156 insertions, 36 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
index 258930c..99c64a5 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/loading/loading.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
index 258930c..99c64a5 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/benchmarks/painting/painting.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui
index ae5e0b5..272d6a7 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui
+++ b/src/3rdparty/webkit/WebKit/qt/tests/hybridPixmap/widget.ui
@@ -18,7 +18,7 @@
<widget class="WebView" name="webView" native="true">
<property name="url" stdset="0">
<url>
- <string>about:blank</string>
+ <string notr="true">about:blank</string>
</url>
</property>
</widget>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 657e09f..14f5820 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -31,6 +31,7 @@ class tst_QGraphicsWebView : public QObject
private slots:
void qgraphicswebview();
void crashOnViewlessWebPages();
+ void microFocusCoordinates();
};
void tst_QGraphicsWebView::qgraphicswebview()
@@ -102,6 +103,40 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
}
+void tst_QGraphicsWebView::microFocusCoordinates()
+{
+ QWebPage* page = new QWebPage;
+ QGraphicsWebView* webView = new QGraphicsWebView;
+ webView->setPage( page );
+ QGraphicsView* view = new QGraphicsView;
+ QGraphicsScene* scene = new QGraphicsScene(view);
+ view->setScene(scene);
+ scene->addItem(webView);
+ view->setGeometry(QRect(0,0,500,500));
+
+ page->mainFrame()->setHtml("<html><body>" \
+ "<input type='text' id='input1' style='font--family: serif' value='' maxlength='20'/><br>" \
+ "<canvas id='canvas1' width='500' height='500'/>" \
+ "<input type='password'/><br>" \
+ "<canvas id='canvas2' width='500' height='500'/>" \
+ "</body></html>");
+
+ page->mainFrame()->setFocus();
+
+ QVariant initialMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus);
+ QVERIFY(initialMicroFocus.isValid());
+
+ page->mainFrame()->scroll(0,300);
+
+ QVariant currentMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus);
+ QVERIFY(currentMicroFocus.isValid());
+
+ QCOMPARE(initialMicroFocus.toRect().translated(QPoint(0,-300)), currentMicroFocus.toRect());
+
+ delete view;
+}
+
+
QTEST_MAIN(tst_QGraphicsWebView)
#include "tst_qgraphicswebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index ca14f6c..bea7a67 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -57,6 +57,7 @@ class MyQObject : public QObject
Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty)
Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty)
Q_PROPERTY(QVariantList variantListProperty READ variantListProperty WRITE setVariantListProperty)
+ Q_PROPERTY(QVariantMap variantMapProperty READ variantMapProperty WRITE setVariantMapProperty)
Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty)
Q_PROPERTY(QStringList stringListProperty READ stringListProperty WRITE setStringListProperty)
Q_PROPERTY(QByteArray byteArrayProperty READ byteArrayProperty WRITE setByteArrayProperty)
@@ -67,6 +68,7 @@ class MyQObject : public QObject
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType)
Q_PROPERTY(QWebElement webElementProperty READ webElementProperty WRITE setWebElementProperty)
+ Q_PROPERTY(QObject* objectStarProperty READ objectStarProperty WRITE setObjectStarProperty)
Q_ENUMS(Policy Strategy)
Q_FLAGS(Ability)
@@ -104,7 +106,13 @@ public:
m_hiddenValue(456.0),
m_writeOnlyValue(789),
m_readOnlyValue(987),
- m_qtFunctionInvoked(-1) { }
+ m_objectStar(0),
+ m_qtFunctionInvoked(-1)
+ {
+ m_variantMapValue.insert("a", QVariant(123));
+ m_variantMapValue.insert("b", QVariant(QLatin1String("foo")));
+ m_variantMapValue.insert("c", QVariant::fromValue<QObject*>(this));
+ }
~MyQObject() { }
@@ -129,6 +137,13 @@ public:
m_variantListValue = value;
}
+ QVariantMap variantMapProperty() const {
+ return m_variantMapValue;
+ }
+ void setVariantMapProperty(const QVariantMap &value) {
+ m_variantMapValue = value;
+ }
+
QString stringProperty() const {
return m_stringValue;
}
@@ -197,6 +212,15 @@ public:
m_customType = c;
}
+ QObject* objectStarProperty() const {
+ return m_objectStar;
+ }
+
+ void setObjectStarProperty(QObject* object) {
+ m_objectStar = object;
+ }
+
+
int qtFunctionInvoked() const {
return m_qtFunctionInvoked;
}
@@ -472,6 +496,7 @@ private:
int m_intValue;
QVariant m_variantValue;
QVariantList m_variantListValue;
+ QVariantMap m_variantMapValue;
QString m_stringValue;
QStringList m_stringListValue;
QByteArray m_byteArrayValue;
@@ -482,6 +507,7 @@ private:
QKeySequence m_shortcut;
QWebElement m_webElement;
CustomType m_customType;
+ QObject* m_objectStar;
int m_qtFunctionInvoked;
QVariantList m_actuals;
};
@@ -747,6 +773,21 @@ void tst_QWebFrame::getSetStaticProperty()
{
QString type;
+ QVariant ret = evalJSV("myObject.variantMapProperty", type);
+ QCOMPARE(type, sObject);
+ QCOMPARE(ret.type(), QVariant::Map);
+ QVariantMap vm = ret.value<QVariantMap>();
+ QCOMPARE(vm.size(), 3);
+ QCOMPARE(vm.value("a").toInt(), 123);
+ QCOMPARE(vm.value("b").toString(), QLatin1String("foo"));
+ QCOMPARE(vm.value("c").value<QObject*>(), m_myObject);
+ }
+ QCOMPARE(evalJS("myObject.variantMapProperty.a === 123"), sTrue);
+ QCOMPARE(evalJS("myObject.variantMapProperty.b === 'foo'"), sTrue);
+ QCOMPARE(evalJS("myObject.variantMapProperty.c.variantMapProperty.b === 'foo'"), sTrue);
+
+ {
+ QString type;
QVariant ret = evalJSV("myObject.stringListProperty", type);
QCOMPARE(type, sArray);
QCOMPARE(ret.type(), QVariant::List);
@@ -878,6 +919,21 @@ void tst_QWebFrame::getSetStaticProperty()
QCOMPARE(evalJS("myObject.readOnlyProperty = 654;"
"myObject.readOnlyProperty == 987"), sTrue);
QCOMPARE(m_myObject->readOnlyProperty(), 987);
+
+ // QObject* property
+ m_myObject->setObjectStarProperty(0);
+ QCOMPARE(m_myObject->objectStarProperty(), (QObject*)0);
+ QCOMPARE(evalJS("myObject.objectStarProperty == null"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject);
+ QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sFalse);
+ QCOMPARE(evalJS("String(myObject.objectStarProperty) == 'null'"), sTrue);
+ QCOMPARE(evalJS("myObject.objectStarProperty.objectStarProperty"),
+ sUndefined);
+ m_myObject->setObjectStarProperty(this);
+ QCOMPARE(evalJS("myObject.objectStarProperty != null"), sTrue);
+ QCOMPARE(evalJS("typeof myObject.objectStarProperty"), sObject);
+ QCOMPARE(evalJS("Boolean(myObject.objectStarProperty)"), sTrue);
+ QCOMPARE(evalJS("String(myObject.objectStarProperty) != 'null'"), sTrue);
}
void tst_QWebFrame::getSetDynamicProperty()
@@ -2841,7 +2897,7 @@ void tst_QWebFrame::evaluateWillCauseRepaint()
#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTest::qWaitForWindowShown(&view);
#else
- QTest::qWait(2000);
+ QTest::qWait(2000);
#endif
view.page()->mainFrame()->evaluateJavaScript(
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebinspector/qwebinspector.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 1f97e69..85d4b60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -80,7 +80,8 @@ private slots:
void modified();
void contextMenuCrash();
void database();
- void createPlugin();
+ void createPluginWithPluginsEnabled();
+ void createPluginWithPluginsDisabled();
void destroyPlugin_data();
void destroyPlugin();
void createViewlessPlugin_data();
@@ -518,27 +519,20 @@ protected:
}
};
-void tst_QWebPage::createPlugin()
+static void createPlugin(QWebView *view)
{
- QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool)));
+ QSignalSpy loadSpy(view, SIGNAL(loadFinished(bool)));
- PluginPage* newPage = new PluginPage(m_view);
- m_view->setPage(newPage);
+ PluginPage* newPage = new PluginPage(view);
+ view->setPage(newPage);
- // plugins not enabled by default, so the plugin shouldn't be loaded
- m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
+ // type has to be application/x-qt-plugin
+ view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>"));
QTRY_COMPARE(loadSpy.count(), 1);
QCOMPARE(newPage->calls.count(), 0);
- m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
-
- // type has to be application/x-qt-plugin
- m_view->setHtml(QString("<html><body><object type='application/x-foobarbaz' classid='pushbutton' id='mybutton'/></body></html>"));
+ view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
QTRY_COMPARE(loadSpy.count(), 2);
- QCOMPARE(newPage->calls.count(), 0);
-
- m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 3);
QCOMPARE(newPage->calls.count(), 1);
{
PluginPage::CallInfo ci = newPage->calls.takeFirst();
@@ -569,11 +563,11 @@ void tst_QWebPage::createPlugin()
QCOMPARE(newPage->mainFrame()->evaluateJavaScript("mybutton.clicked.toString()").toString(),
QString::fromLatin1("function clicked() {\n [native code]\n}"));
- m_view->setHtml(QString("<html><body><table>"
+ view->setHtml(QString("<html><body><table>"
"<tr><object type='application/x-qt-plugin' classid='lineedit' id='myedit'/></tr>"
"<tr><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></tr>"
"</table></body></html>"), QUrl("http://foo.bar.baz"));
- QTRY_COMPARE(loadSpy.count(), 4);
+ QTRY_COMPARE(loadSpy.count(), 3);
QCOMPARE(newPage->calls.count(), 2);
{
PluginPage::CallInfo ci = newPage->calls.takeFirst();
@@ -605,14 +599,22 @@ void tst_QWebPage::createPlugin()
QVERIFY(ci.returnValue != 0);
QVERIFY(ci.returnValue->inherits("QPushButton"));
}
+}
- m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
-
- m_view->setHtml(QString("<html><body><object type='application/x-qt-plugin' classid='pushbutton' id='mybutton'/></body></html>"));
- QTRY_COMPARE(loadSpy.count(), 5);
- QCOMPARE(newPage->calls.count(), 0);
+void tst_QWebPage::createPluginWithPluginsEnabled()
+{
+ m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ createPlugin(m_view);
}
+void tst_QWebPage::createPluginWithPluginsDisabled()
+{
+ // Qt Plugins should be loaded by QtWebKit even when PluginsEnabled is
+ // false. The client decides whether a Qt plugin is enabled or not when
+ // it decides whether or not to instantiate it.
+ m_view->settings()->setAttribute(QWebSettings::PluginsEnabled, false);
+ createPlugin(m_view);
+}
// Standard base class for template PluginTracerPage. In tests it is used as interface.
class PluginCounterPage : public QWebPage {
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index 6777615..e915d60 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -1,3 +1,3 @@
isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
-exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index ebcf4bb..100399e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -48,6 +48,7 @@ private slots:
void reusePage_data();
void reusePage();
+ void microFocusCoordinates();
void crashTests();
};
@@ -203,6 +204,31 @@ void tst_QWebView::crashTests()
QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed.
}
+void tst_QWebView::microFocusCoordinates()
+{
+ QWebPage* page = new QWebPage;
+ QWebView* webView = new QWebView;
+ webView->setPage( page );
+
+ page->mainFrame()->setHtml("<html><body>" \
+ "<input type='text' id='input1' style='font--family: serif' value='' maxlength='20'/><br>" \
+ "<canvas id='canvas1' width='500' height='500'/>" \
+ "<input type='password'/><br>" \
+ "<canvas id='canvas2' width='500' height='500'/>" \
+ "</body></html>");
+
+ page->mainFrame()->setFocus();
+
+ QVariant initialMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus);
+ QVERIFY(initialMicroFocus.isValid());
+
+ page->mainFrame()->scroll(0,50);
+
+ QVariant currentMicroFocus = page->inputMethodQuery(Qt::ImMicroFocus);
+ QVERIFY(currentMicroFocus.isValid());
+
+ QCOMPARE(initialMicroFocus.toRect().translated(QPoint(0,-50)), currentMicroFocus.toRect());
+}
QTEST_MAIN(tst_QWebView)
#include "tst_qwebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pri b/src/3rdparty/webkit/WebKit/qt/tests/tests.pri
index 0a8f98c..525e662 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pri
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pri
@@ -2,6 +2,7 @@ TEMPLATE = app
CONFIG -= app_bundle
VPATH += $$_PRO_FILE_PWD_
+# Add the tst_ prefix, In QTDIR_build it's done by qttest_p4.prf
!CONFIG(QTDIR_build):TARGET = tst_$$TARGET
SOURCES += $${TARGET}.cpp
INCLUDEPATH += \