aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index c24c495b13..18ff10b6f4 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -370,6 +370,7 @@ private slots:
void undefinedPropertiesInObjectWrapper();
void hugeRegexpQuantifiers();
void singletonTypeWrapperLookup();
+ void getThisObject();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -9029,6 +9030,17 @@ void tst_qqmlecmascript::singletonTypeWrapperLookup()
QCOMPARE(test->property("secondLookup").toInt(), singleton2->testVar);
}
+void tst_qqmlecmascript::getThisObject()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("getThis.qml"));
+ QVERIFY(component.isReady());
+ QScopedPointer<QObject> test(component.create());
+ QVERIFY(!test.isNull());
+
+ QTRY_COMPARE(qvariant_cast<QObject *>(test->property("self")), test.data());
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"