aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp')
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index f4765d0e8d..8ad2b6ba2b 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -338,19 +338,17 @@ void tst_QQuickWorkerScript::script_global()
delete worker;
}
+ qquickworkerscript_lastWarning = QString();
+
{
+ QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
+
QQmlComponent component(&m_engine, testFileUrl("worker_global2.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
QVERIFY(worker != 0);
- QString value("Hello");
-
- QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
-
- QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
-
QTRY_COMPARE(qquickworkerscript_lastWarning,
- testFileUrl("script_global.js").toString() + QLatin1String(":2: Invalid write to global property \"world\""));
+ testFileUrl("script_global2.js").toString() + QLatin1String(":1: Invalid write to global property \"world\""));
qInstallMessageHandler(previousMsgHandler);