aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalHandlers.qml11
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/signalHandlers.qml b/tests/auto/qml/qqmlecmascript/data/signalHandlers.qml
index 7e85312692..cd68fb9b82 100644
--- a/tests/auto/qml/qqmlecmascript/data/signalHandlers.qml
+++ b/tests/auto/qml/qqmlecmascript/data/signalHandlers.qml
@@ -91,4 +91,15 @@ QtObject {
testObjectWithAliasHandler.count++
return testObjectWithAliasHandler.testSuccess
}
+
+ signal signalWithClosureArgument(var f)
+ onSignalWithClosureArgument: f()
+
+ function testSignalWithClosureArgument() {
+ var testSuccess = false
+ signalWithClosureArgument(function() {
+ testSuccess = true
+ })
+ return testSuccess
+ }
}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 7b89709923..d06266a360 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -6068,6 +6068,9 @@ void tst_qqmlecmascript::signalHandlers()
QMetaObject::invokeMethod(o, "testAliasSignalHandler", Q_RETURN_ARG(QVariant, result));
QCOMPARE(result.toBool(), true);
+ QMetaObject::invokeMethod(o, "testSignalWithClosureArgument", Q_RETURN_ARG(QVariant, result));
+ QCOMPARE(result.toBool(), true);
+
delete o;
}