summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-13 16:35:48 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:42 +0100
commit5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch)
treeddce1aa5e3b6967a69691892e500897558ff8ab6 /WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
parent12bec63ec71e46baba27f0bd9bd9d8067683690a (diff)
downloadexternal_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebKit/qt/tests/qwebframe/tst_qwebframe.cpp')
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp74
1 files changed, 2 insertions, 72 deletions
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 98ce663..2c63739 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,7 +38,6 @@
#include <qsslerror.h>
#endif
#include "../util.h"
-#include "../WebCoreSupport/DumpRenderTreeSupportQt.h"
struct CustomType {
QString string;
@@ -572,11 +571,9 @@ public slots:
void cleanup();
private slots:
+ void getSetStaticProperty();
void getSetDynamicProperty();
- void getSetDynamicProperty_data();
void getSetChildren();
- void getSetChildren_data();
- void getSetStaticProperty();
void callQtInvokable();
void connectAndDisconnect();
void classEnums();
@@ -674,10 +671,6 @@ private:
evalJS("delete retvalue; delete typevalue");
return ret;
}
- void garbageCollectJS()
- {
- DumpRenderTreeSupportQt::garbageCollectorCollect();
- }
QObject* firstChildByClassName(QObject* parent, const char* className) {
const QObjectList & children = parent->children();
foreach (QObject* child, children) {
@@ -954,8 +947,6 @@ void tst_QWebFrame::getSetStaticProperty()
void tst_QWebFrame::getSetDynamicProperty()
{
- QFETCH(bool, garbageCollect);
-
// initially the object does not have the property
// In WebKit, RuntimeObjects do not inherit Object, so don't have hasOwnProperty
@@ -967,34 +958,11 @@ void tst_QWebFrame::getSetDynamicProperty()
//QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sTrue);
QCOMPARE(evalJS("typeof myObject.dynamicProperty != 'undefined'"), sTrue);
QCOMPARE(evalJS("myObject.dynamicProperty == 123"), sTrue);
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(evalJS("typeof myObject.dynamicProperty != 'undefined'"), sTrue);
- }
// property change in script should be reflected in C++
QCOMPARE(evalJS("myObject.dynamicProperty = 'foo';"
"myObject.dynamicProperty"), QLatin1String("foo"));
QCOMPARE(m_myObject->property("dynamicProperty").toString(), QLatin1String("foo"));
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(m_myObject->property("dynamicProperty").toString(), QLatin1String("foo"));
- }
-
- // add a dynamic property in C++ to another QObject
- QObject* propertyObject = new QObject(m_myObject);
- QCOMPARE(m_myObject->setProperty("dynamicObjectProperty", qVariantFromValue(propertyObject)), false);
- QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty != 'undefined'"), sTrue);
- evalJS("myObject.dynamicObjectProperty.jsProperty = 123");
- QCOMPARE(evalJS("myObject.dynamicObjectProperty.jsProperty == 123"), sTrue);
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty != 'undefined'"), sTrue);
- QCOMPARE(evalJS("myObject.dynamicObjectProperty.jsProperty == 123"), sTrue);
- }
- QCOMPARE(m_myObject->setProperty("dynamicObjectProperty", QVariant()), false);
- delete propertyObject;
- QCOMPARE(evalJS("typeof myObject.dynamicObjectProperty == 'undefined'"), sTrue);
// delete the property (XFAIL - can't delete properties)
QEXPECT_FAIL("", "can't delete properties", Continue);
@@ -1005,21 +973,10 @@ void tst_QWebFrame::getSetDynamicProperty()
// QCOMPARE(evalJS("myObject.hasOwnProperty('dynamicProperty')"), sFalse);
QCOMPARE(evalJS("typeof myObject.dynamicProperty"), sUndefined);
*/
-
- evalJS("myObject.dynamicProperty = undefined");
-}
-
-void tst_QWebFrame::getSetDynamicProperty_data()
-{
- QTest::addColumn<bool>("garbageCollect");
- QTest::newRow("with garbageCollect") << true;
- QTest::newRow("without garbageCollect") << false;
}
void tst_QWebFrame::getSetChildren()
{
- QFETCH(bool, garbageCollect);
-
// initially the object does not have the child
// (again, no hasOwnProperty)
@@ -1031,27 +988,12 @@ void tst_QWebFrame::getSetChildren()
child->setObjectName("child");
// QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sTrue);
QCOMPARE(evalJS("typeof myObject.child != 'undefined'"), sTrue);
- evalJS("myObject.child.jsProperty = 123");
- QCOMPARE(evalJS("myObject.child.jsProperty == 123"), sTrue);
-
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(evalJS("typeof myObject.child != 'undefined'"), sTrue);
- QCOMPARE(evalJS("myObject.child.jsProperty == 123"), sTrue);
- }
// add a grandchild
MyQObject* grandChild = new MyQObject(child);
grandChild->setObjectName("grandChild");
// QCOMPARE(evalJS("myObject.child.hasOwnProperty('grandChild')"), sTrue);
QCOMPARE(evalJS("typeof myObject.child.grandChild != 'undefined'"), sTrue);
- evalJS("myObject.child.grandChild.jsProperty = 123");
- evalJS("myObject.child.grandChild.jsProperty = 123");
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(evalJS("typeof myObject.child.grandChild != 'undefined'"), sTrue);
- QCOMPARE(evalJS("myObject.child.grandChild.jsProperty == 123"), sTrue);
- }
// delete grandchild
delete grandChild;
@@ -1062,18 +1004,6 @@ void tst_QWebFrame::getSetChildren()
delete child;
// QCOMPARE(evalJS("myObject.hasOwnProperty('child')"), sFalse);
QCOMPARE(evalJS("typeof myObject.child == 'undefined'"), sTrue);
- if( garbageCollect ) {
- garbageCollectJS();
- QCOMPARE(evalJS("typeof myObject.child == 'undefined'"), sTrue);
- }
-}
-
-
-void tst_QWebFrame::getSetChildren_data()
-{
- QTest::addColumn<bool>("garbageCollect");
- QTest::newRow("with garbageCollect") << true;
- QTest::newRow("without garbageCollect") << false;
}
Q_DECLARE_METATYPE(QVector<int>)
@@ -1740,7 +1670,7 @@ void tst_QWebFrame::connectAndDisconnect()
m_myObject->emitMySignal();
QCOMPARE(m_myObject->qtFunctionInvoked(), 20);
evalJS("myObject = null");
- garbageCollectJS();
+ evalJS("gc()");
m_myObject->resetQtFunctionInvoked();
m_myObject->emitMySignal();
QCOMPARE(m_myObject->qtFunctionInvoked(), 20);