diff options
Diffstat (limited to 'tests/auto/qml')
-rw-r--r-- | tests/auto/qml/qjsvalue/tst_qjsvalue.cpp | 15 | ||||
-rw-r--r-- | tests/auto/qml/qjsvalue/tst_qjsvalue.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp index 6e91cec474..94068bfa12 100644 --- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp +++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp @@ -2756,4 +2756,19 @@ void tst_QJSValue::stringAndUrl() QCOMPARE(engine.fromScriptValue<QUrl>(immediateStringValue), url); } +void tst_QJSValue::jsFunctionInVariant() +{ + QJSEngine engine; + engine.installExtensions(QJSEngine::ConsoleExtension); + QJSValue console = engine.globalObject().property("console"); + QVERIFY(console.isObject()); + QJSValue log = console.property("log"); + QVERIFY(log.isCallable()); + + { + QTest::ignoreMessage(QtDebugMsg, "direct call"); + log.callWithInstance(console, {"direct call"}); + } +} + QTEST_MAIN(tst_QJSValue) diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.h b/tests/auto/qml/qjsvalue/tst_qjsvalue.h index f6e3c2aacf..a291e156e0 100644 --- a/tests/auto/qml/qjsvalue/tst_qjsvalue.h +++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.h @@ -145,6 +145,7 @@ private slots: void deleteFromDifferentThread(); void stringAndUrl(); + void jsFunctionInVariant(); private: void newEngine() |