aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp40
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp5
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile1.qml49
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile2.qml46
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile3.qml68
-rw-r--r--tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp45
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp1
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp83
-rw-r--r--tests/auto/qmltest/animatedimage/tst_animatedimage.qml2
-rw-r--r--tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_behavior.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixed.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixedparallel.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixedsequential.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_multiwindow.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_nested.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_on.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_opacity.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_parallel.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_restart.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_rotation.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_scale.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_sequential.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_targetdestroyed.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_transformorigin.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_transition.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_x.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_y.qml2
-rw-r--r--tests/auto/qmltest/borderimage/tst_borderimage.qml2
-rw-r--r--tests/auto/qmltest/buttonclick/tst_buttonclick.qml2
-rw-r--r--tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml2
-rw-r--r--tests/auto/qmltest/events/tst_drag.qml2
-rw-r--r--tests/auto/qmltest/events/tst_events.qml2
-rw-r--r--tests/auto/qmltest/events/tst_wheel.qml2
-rw-r--r--tests/auto/qmltest/fontloader/tst_fontloader.qml2
-rw-r--r--tests/auto/qmltest/gradient/tst_gradient.qml2
-rw-r--r--tests/auto/qmltest/image/tst_image.qml2
-rw-r--r--tests/auto/qmltest/item/tst_layerInPositioner.qml2
-rw-r--r--tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml2
-rw-r--r--tests/auto/qmltest/listmodel/tst_listmodel.qml2
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml2
-rw-r--r--tests/auto/qmltest/pathview/tst_pathview.qml2
-rw-r--r--tests/auto/qmltest/pixel/tst_pixel.qml2
-rw-r--r--tests/auto/qmltest/qqmlbinding/tst_binding.qml2
-rw-r--r--tests/auto/qmltest/qqmlbinding/tst_binding2.qml2
-rw-r--r--tests/auto/qmltest/rectangle/tst_rectangle.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_compare.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_compare_quickobjects.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_datadriven.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_destroy.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_findChild.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_selftests.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourceItem.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml2
-rw-r--r--tests/auto/qmltest/stability/tst_unloadrepeater.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_anonymousstate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_guardcondition.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_historystate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_initialstate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_parallelmachine.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_trafficlight.qml2
-rw-r--r--tests/auto/qmltest/text/tst_text.qml2
-rw-r--r--tests/auto/qmltest/textedit/tst_textedit.qml2
-rw-r--r--tests/auto/qmltest/textinput/tst_textinput.qml2
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp27
-rwxr-xr-xtests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml2
-rwxr-xr-xtests/auto/quick/qquickanimationcontroller/data/tst_completion.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_context.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml2
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp24
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp2
-rw-r--r--tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml2
-rw-r--r--tests/auto/quick/qquickwindow/data/windowattached.qml2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp27
85 files changed, 456 insertions, 107 deletions
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
index c4c2705e01..e4c14a2e10 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -54,7 +54,6 @@ class tst_QQmlEngineDebugInspectorIntegration : public QQmlDataTest
public:
tst_QQmlEngineDebugInspectorIntegration()
: m_process(0)
- , m_connection(0)
, m_inspectorClient(0)
, m_engineDebugClient(0)
{
@@ -65,7 +64,6 @@ private:
QmlDebugObjectReference findRootObject();
QQmlDebugProcess *m_process;
- QQmlDebugConnection *m_connection;
QQmlInspectorClient *m_inspectorClient;
QQmlEngineDebugClient *m_engineDebugClient;
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index 5bbbe8e1e9..7c931928d4 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -36,6 +36,7 @@
#include <QHostAddress>
#include <QDebug>
#include <QThread>
+#include <QModelIndex>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcontext.h>
@@ -73,6 +74,16 @@ signals:
};
QML_DECLARE_TYPE(NonScriptProperty)
+class CustomTypes : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QModelIndex modelIndex READ modelIndex)
+public:
+ CustomTypes(QObject *parent = 0) : QObject(parent) {}
+
+ QModelIndex modelIndex() { return QModelIndex(); }
+};
+
class tst_QQmlEngineDebugService : public QObject
{
Q_OBJECT
@@ -125,6 +136,7 @@ private slots:
void setBindingInStates();
void regression_QTCREATORBUG_7451();
+ void queryObjectWithNonStreamableTypes();
};
QmlDebugObjectReference tst_QQmlEngineDebugService::findRootObject(
@@ -314,6 +326,12 @@ void tst_QQmlEngineDebugService::initTestCase()
"}\n"
;
+ // test non-streamable properties
+ qmlRegisterType<CustomTypes>("Backend", 1, 0, "CustomTypes");
+ qml << "import Backend 1.0\n"
+ "CustomTypes {}"
+ ;
+
for (int i=0; i<qml.count(); i++) {
QQmlComponent component(m_engine);
component.setData(qml[i], QUrl::fromLocalFile(""));
@@ -620,7 +638,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
// root context query sends only root object data - it doesn't fill in
// the children or property info
QCOMPARE(context.objects.count(), 0);
- QCOMPARE(context.contexts.count(), 5);
+ QCOMPARE(context.contexts.count(), 6);
QVERIFY(context.contexts[0].debugId >= 0);
QCOMPARE(context.contexts[0].name, QString("tst_QQmlDebug_childContext"));
}
@@ -819,6 +837,26 @@ void tst_QQmlEngineDebugService::regression_QTCREATORBUG_7451()
}
}
+void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes()
+{
+ bool success;
+
+ QmlDebugObjectReference rootObject = findRootObject(4, true);
+
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ unconnected->queryObject(rootObject, &success);
+ QVERIFY(!success);
+ delete unconnected;
+
+ m_dbg->queryObject(rootObject, &success);
+ QVERIFY(success);
+ QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result())));
+
+ QmlDebugObjectReference obj = m_dbg->object();
+
+ QCOMPARE(findProperty(obj.properties, "modelIndex").value, QVariant());
+}
+
void tst_QQmlEngineDebugService::queryExpressionResult()
{
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 2e7fe34796..4e9da046b5 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -3200,6 +3200,11 @@ void tst_QJSEngine::installTranslatorFunctions()
QVERIFY(ret.isString());
QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
}
+ {
+ QJSValue ret = eng.evaluate("qsTr('%1').arg('foo')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
+ }
QVERIFY(eng.evaluate("QT_TRID_NOOP()").isUndefined());
}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml
new file mode 100644
index 0000000000..3bd8e22ce4
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ Item {
+ id: c1
+ }
+ property Item a: c1
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml
new file mode 100644
index 0000000000..9a32114918
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ property variant a: Qt.rgba(0.3, 0.4, 0.5, 0.6)
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml
new file mode 100644
index 0000000000..c55c355388
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+
+ ListView {
+ anchors.fill: parent
+ model: simpleModel
+ delegate: Text {
+ text: name
+ }
+ }
+
+ ListModel {
+ id: simpleModel
+ ListElement {
+ name: "first"
+ }
+ ListElement {
+ name: "second"
+ }
+ ListElement {
+ name: "third"
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
index fcc3e6a0a9..c8fae624a7 100644
--- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
+++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
@@ -46,6 +46,7 @@ public:
private slots:
void test_qmlClearTypeRegistrations();
+ void test_valueTypeProviderModule(); // QTBUG-43004
};
void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations()
@@ -85,6 +86,50 @@ void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations()
delete component;
}
+static void cleanState(QQmlEngine **e)
+{
+ delete *e;
+ qmlClearTypeRegistrations();
+ *e = new QQmlEngine;
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::processEvents();
+}
+
+void tst_qqmlenginecleanup::test_valueTypeProviderModule()
+{
+ // this test ensures that a module which installs a value type
+ // provider can be reinitialized after multiple calls to
+ // qmlClearTypeRegistrations() without causing cycles in the
+ // value type provider list.
+ QQmlEngine *e = 0;
+ QUrl testFile1 = testFileUrl("testFile1.qml");
+ QUrl testFile2 = testFileUrl("testFile2.qml");
+ bool noCycles = false;
+ for (int i = 0; i < 20; ++i) {
+ cleanState(&e);
+ QQmlComponent c(e, this);
+ c.loadUrl(i % 2 == 0 ? testFile1 : testFile2); // this will hang if cycles exist.
+ }
+ delete e;
+ e = 0;
+ noCycles = true;
+ QVERIFY(noCycles);
+
+ // this test ensures that no crashes occur due to using
+ // a dangling QQmlType pointer in the type compiler
+ // which results from qmlClearTypeRegistrations()
+ QUrl testFile3 = testFileUrl("testFile3.qml");
+ bool noDangling = false;
+ for (int i = 0; i < 20; ++i) {
+ cleanState(&e);
+ QQmlComponent c(e, this);
+ c.loadUrl(i % 2 == 0 ? testFile1 : testFile3); // this will crash if dangling ptr exists.
+ }
+ delete e;
+ noDangling = true;
+ QVERIFY(noDangling);
+}
+
QTEST_MAIN(tst_qqmlenginecleanup)
#include "tst_qqmlenginecleanup.moc"
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index deb3f4e11b..1cdf8ce574 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -46,7 +46,6 @@
// From qquickfolderlistmodel.h
const int FileNameRole = Qt::UserRole+1;
-const int FilePathRole = Qt::UserRole+2;
enum SortField { Unsorted, Name, Time, Size, Type };
class tst_qquickfolderlistmodel : public QQmlDataTest
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index 3fe14fa216..63bfffacaa 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -33,6 +33,8 @@
#include <QtTest/QtTest>
#include <QJSEngine>
+#include <QQmlEngine>
+#include <QQmlComponent>
#include <private/qv4engine_p.h>
#include <private/qv4debugging_p.h>
#include <private/qv8engine_p.h>
@@ -182,6 +184,14 @@ public:
m_stackTrace = debugger->stackTrace();
+ while (!m_expressionRequests.isEmpty()) {
+ ExpressionRequest request = m_expressionRequests.takeFirst();
+ QVariantMap result;
+ collector.setDestination(&result);
+ debugger->evaluateExpression(request.frameNr, request.expression, &collector);
+ m_expressionResults << result[QString::fromLatin1("body")];
+ }
+
if (m_captureContextInfo)
captureContextInfo(debugger);
@@ -233,6 +243,13 @@ public:
QList<QVariantMap> m_capturedLocals;
QVariant m_thrownValue;
+ struct ExpressionRequest {
+ QString expression;
+ int frameNr;
+ };
+ QVector<ExpressionRequest> m_expressionRequests;
+ QVector<QVariant> m_expressionResults;
+
// Utility methods:
void dumpStackTrace() const
{
@@ -259,6 +276,7 @@ private slots:
void addBreakPointWhilePaused();
void removeBreakPointForNextInstruction();
void conditionalBreakPoint();
+ void conditionalBreakPointInQml();
// context access:
void readArguments();
@@ -269,6 +287,8 @@ private slots:
// exceptions:
void pauseOnThrow();
+ void evaluateExpression();
+
private:
void evaluateJavaScript(const QString &script, const QString &fileName, int lineNumber = 1)
{
@@ -428,6 +448,42 @@ void tst_qv4debugger::conditionalBreakPoint()
QCOMPARE(m_debuggerAgent->m_capturedLocals[0]["i"].toInt(), 11);
}
+void tst_qv4debugger::conditionalBreakPointInQml()
+{
+ QQmlEngine engine;
+ QV4::ExecutionEngine *v4 = QV8Engine::getV4(&engine);
+ v4->enableDebugger();
+
+ QScopedPointer<QThread> debugThread(new QThread);
+ debugThread->start();
+ QScopedPointer<TestAgent> debuggerAgent(new TestAgent);
+ debuggerAgent->addDebugger(v4->debugger);
+ debuggerAgent->moveToThread(debugThread.data());
+
+ QQmlComponent component(&engine);
+ component.setData("import QtQml 2.0\n"
+ "QtObject {\n"
+ " id: root\n"
+ " property int foo: 42\n"
+ " property bool success: false\n"
+ " Component.onCompleted: {\n"
+ " success = true;\n" // breakpoint here
+ " }\n"
+ "}\n", QUrl("test.qml"));
+
+ debuggerAgent->addBreakPoint("test.qml", 7, /*enabled*/true, "root.foo == 42");
+
+ QScopedPointer<QObject> obj(component.create());
+ QCOMPARE(obj->property("success").toBool(), true);
+
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.count(), 1);
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).fileName, QStringLiteral("test.qml"));
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).lineNumber, 7);
+
+ debugThread->quit();
+ debugThread->wait();
+}
+
void tst_qv4debugger::readArguments()
{
m_debuggerAgent->m_captureContextInfo = true;
@@ -556,6 +612,33 @@ void tst_qv4debugger::pauseOnThrow()
QCOMPARE(m_debuggerAgent->m_thrownValue.toString(), QString("hard"));
}
+void tst_qv4debugger::evaluateExpression()
+{
+ QString script =
+ "function testFunction() {\n"
+ " var x = 10\n"
+ " return x\n" // breakpoint
+ "}\n"
+ "var x = 20\n"
+ "testFunction()\n";
+
+ TestAgent::ExpressionRequest request;
+ request.expression = "x";
+ request.frameNr = 0;
+ m_debuggerAgent->m_expressionRequests << request;
+ request.expression = "x";
+ request.frameNr = 1;
+ m_debuggerAgent->m_expressionRequests << request;
+
+ m_debuggerAgent->addBreakPoint("evaluateExpression", 3);
+
+ evaluateJavaScript(script, "evaluateExpression");
+
+ QCOMPARE(m_debuggerAgent->m_expressionResults.count(), 2);
+ QCOMPARE(m_debuggerAgent->m_expressionResults[0].toInt(), 10);
+ QCOMPARE(m_debuggerAgent->m_expressionResults[1].toInt(), 20);
+}
+
QTEST_MAIN(tst_qv4debugger)
#include "tst_qv4debugger.moc"
diff --git a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
index d0574da4f5..a58a19fa58 100644
--- a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
+++ b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
index 6d4b17f83e..008f0ad445 100644
--- a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
+++ b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
Rectangle {
diff --git a/tests/auto/qmltest/animators/tst_behavior.qml b/tests/auto/qmltest/animators/tst_behavior.qml
index 87b0efff17..17b9bee0e2 100644
--- a/tests/auto/qmltest/animators/tst_behavior.qml
+++ b/tests/auto/qmltest/animators/tst_behavior.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixed.qml b/tests/auto/qmltest/animators/tst_mixed.qml
index 488f1c8156..1e3600f80f 100644
--- a/tests/auto/qmltest/animators/tst_mixed.qml
+++ b/tests/auto/qmltest/animators/tst_mixed.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixedparallel.qml b/tests/auto/qmltest/animators/tst_mixedparallel.qml
index 2b6ebfc17a..51372008e1 100644
--- a/tests/auto/qmltest/animators/tst_mixedparallel.qml
+++ b/tests/auto/qmltest/animators/tst_mixedparallel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixedsequential.qml b/tests/auto/qmltest/animators/tst_mixedsequential.qml
index 6165cf5438..d1b0f92f59 100644
--- a/tests/auto/qmltest/animators/tst_mixedsequential.qml
+++ b/tests/auto/qmltest/animators/tst_mixedsequential.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_multiwindow.qml b/tests/auto/qmltest/animators/tst_multiwindow.qml
index de73434aab..f0f42725ba 100644
--- a/tests/auto/qmltest/animators/tst_multiwindow.qml
+++ b/tests/auto/qmltest/animators/tst_multiwindow.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
import QtQuick.Window 2.0
Item {
diff --git a/tests/auto/qmltest/animators/tst_nested.qml b/tests/auto/qmltest/animators/tst_nested.qml
index 0426dd96e7..fba5d8350d 100644
--- a/tests/auto/qmltest/animators/tst_nested.qml
+++ b/tests/auto/qmltest/animators/tst_nested.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_on.qml b/tests/auto/qmltest/animators/tst_on.qml
index d6be945723..e82711bb50 100644
--- a/tests/auto/qmltest/animators/tst_on.qml
+++ b/tests/auto/qmltest/animators/tst_on.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_opacity.qml b/tests/auto/qmltest/animators/tst_opacity.qml
index 37603a9ced..94f639e30c 100644
--- a/tests/auto/qmltest/animators/tst_opacity.qml
+++ b/tests/auto/qmltest/animators/tst_opacity.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_parallel.qml b/tests/auto/qmltest/animators/tst_parallel.qml
index 7702dd7dd8..074c7442f7 100644
--- a/tests/auto/qmltest/animators/tst_parallel.qml
+++ b/tests/auto/qmltest/animators/tst_parallel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_restart.qml b/tests/auto/qmltest/animators/tst_restart.qml
index 3bacf6cb6a..fd9bd46c46 100644
--- a/tests/auto/qmltest/animators/tst_restart.qml
+++ b/tests/auto/qmltest/animators/tst_restart.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_rotation.qml b/tests/auto/qmltest/animators/tst_rotation.qml
index 9ff4278527..deb6006801 100644
--- a/tests/auto/qmltest/animators/tst_rotation.qml
+++ b/tests/auto/qmltest/animators/tst_rotation.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_scale.qml b/tests/auto/qmltest/animators/tst_scale.qml
index 10f3430c84..62f8fe1264 100644
--- a/tests/auto/qmltest/animators/tst_scale.qml
+++ b/tests/auto/qmltest/animators/tst_scale.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_sequential.qml b/tests/auto/qmltest/animators/tst_sequential.qml
index 9841413f70..232d084481 100644
--- a/tests/auto/qmltest/animators/tst_sequential.qml
+++ b/tests/auto/qmltest/animators/tst_sequential.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_targetdestroyed.qml b/tests/auto/qmltest/animators/tst_targetdestroyed.qml
index 92b14d0594..92ed3bda3e 100644
--- a/tests/auto/qmltest/animators/tst_targetdestroyed.qml
+++ b/tests/auto/qmltest/animators/tst_targetdestroyed.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_transformorigin.qml b/tests/auto/qmltest/animators/tst_transformorigin.qml
index bd3483dad5..d11e2040ba 100644
--- a/tests/auto/qmltest/animators/tst_transformorigin.qml
+++ b/tests/auto/qmltest/animators/tst_transformorigin.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_transition.qml b/tests/auto/qmltest/animators/tst_transition.qml
index 67230d2adf..c5becfe68b 100644
--- a/tests/auto/qmltest/animators/tst_transition.qml
+++ b/tests/auto/qmltest/animators/tst_transition.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_x.qml b/tests/auto/qmltest/animators/tst_x.qml
index 35e410e8e2..32f2eac75d 100644
--- a/tests/auto/qmltest/animators/tst_x.qml
+++ b/tests/auto/qmltest/animators/tst_x.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_y.qml b/tests/auto/qmltest/animators/tst_y.qml
index 79fd50e8bf..792cc91782 100644
--- a/tests/auto/qmltest/animators/tst_y.qml
+++ b/tests/auto/qmltest/animators/tst_y.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/borderimage/tst_borderimage.qml b/tests/auto/qmltest/borderimage/tst_borderimage.qml
index 49b4397ea9..91b0310009 100644
--- a/tests/auto/qmltest/borderimage/tst_borderimage.qml
+++ b/tests/auto/qmltest/borderimage/tst_borderimage.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
index aead8b91f2..18882587a9 100644
--- a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
+++ b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Button {
id: button
diff --git a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
index f504c8f901..8da6fb1150 100644
--- a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
+++ b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
id: top
diff --git a/tests/auto/qmltest/events/tst_drag.qml b/tests/auto/qmltest/events/tst_drag.qml
index 76682ab6fb..1665a8e0ae 100644
--- a/tests/auto/qmltest/events/tst_drag.qml
+++ b/tests/auto/qmltest/events/tst_drag.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle{
id: root
diff --git a/tests/auto/qmltest/events/tst_events.qml b/tests/auto/qmltest/events/tst_events.qml
index 1ae5d5fbb2..ea6e4ea4fb 100644
--- a/tests/auto/qmltest/events/tst_events.qml
+++ b/tests/auto/qmltest/events/tst_events.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
width: 50; height: 50
diff --git a/tests/auto/qmltest/events/tst_wheel.qml b/tests/auto/qmltest/events/tst_wheel.qml
index 707b5d46bb..8504939633 100644
--- a/tests/auto/qmltest/events/tst_wheel.qml
+++ b/tests/auto/qmltest/events/tst_wheel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:top
diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml
index be24bb603d..ea0d8bc7f4 100644
--- a/tests/auto/qmltest/fontloader/tst_fontloader.qml
+++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/gradient/tst_gradient.qml b/tests/auto/qmltest/gradient/tst_gradient.qml
index c25ac19e84..1e9f7d4373 100644
--- a/tests/auto/qmltest/gradient/tst_gradient.qml
+++ b/tests/auto/qmltest/gradient/tst_gradient.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/image/tst_image.qml b/tests/auto/qmltest/image/tst_image.qml
index 1afa5f8274..a507dfe508 100644
--- a/tests/auto/qmltest/image/tst_image.qml
+++ b/tests/auto/qmltest/image/tst_image.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/item/tst_layerInPositioner.qml b/tests/auto/qmltest/item/tst_layerInPositioner.qml
index 706c895264..69f29be269 100644
--- a/tests/auto/qmltest/item/tst_layerInPositioner.qml
+++ b/tests/auto/qmltest/item/tst_layerInPositioner.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.4
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
index 4e60e2d8d6..1a79cb4935 100644
--- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
+++ b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.4
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/listmodel/tst_listmodel.qml b/tests/auto/qmltest/listmodel/tst_listmodel.qml
index 603993a092..aae9ec42ec 100644
--- a/tests/auto/qmltest/listmodel/tst_listmodel.qml
+++ b/tests/auto/qmltest/listmodel/tst_listmodel.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index 069b62a726..7b7242d17d 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/pathview/tst_pathview.qml b/tests/auto/qmltest/pathview/tst_pathview.qml
index 820034c960..a6b440e0b8 100644
--- a/tests/auto/qmltest/pathview/tst_pathview.qml
+++ b/tests/auto/qmltest/pathview/tst_pathview.qml
@@ -1,5 +1,5 @@
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/pixel/tst_pixel.qml b/tests/auto/qmltest/pixel/tst_pixel.qml
index 6e4055b367..9b0b9e57c1 100644
--- a/tests/auto/qmltest/pixel/tst_pixel.qml
+++ b/tests/auto/qmltest/pixel/tst_pixel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:rect
diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding.qml b/tests/auto/qmltest/qqmlbinding/tst_binding.qml
index 81f9c04b55..35cf7e071d 100644
--- a/tests/auto/qmltest/qqmlbinding/tst_binding.qml
+++ b/tests/auto/qmltest/qqmlbinding/tst_binding.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id: screen
diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
index b1f2143751..944f88b072 100644
--- a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
+++ b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id: screen
diff --git a/tests/auto/qmltest/rectangle/tst_rectangle.qml b/tests/auto/qmltest/rectangle/tst_rectangle.qml
index caf40cdb26..a0a6ee4862 100644
--- a/tests/auto/qmltest/rectangle/tst_rectangle.qml
+++ b/tests/auto/qmltest/rectangle/tst_rectangle.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/selftests/tst_compare.qml b/tests/auto/qmltest/selftests/tst_compare.qml
index efb4ce0349..2c1ecb5223 100644
--- a/tests/auto/qmltest/selftests/tst_compare.qml
+++ b/tests/auto/qmltest/selftests/tst_compare.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests_compare"
diff --git a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
index f246f0b116..de652ae044 100644
--- a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
+++ b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests_compare_QuickObjects"
diff --git a/tests/auto/qmltest/selftests/tst_datadriven.qml b/tests/auto/qmltest/selftests/tst_datadriven.qml
index cc3afc43b5..a371bc9034 100644
--- a/tests/auto/qmltest/selftests/tst_datadriven.qml
+++ b/tests/auto/qmltest/selftests/tst_datadriven.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
TestCase {
diff --git a/tests/auto/qmltest/selftests/tst_destroy.qml b/tests/auto/qmltest/selftests/tst_destroy.qml
index 764f21ecbc..d943c5ed7a 100644
--- a/tests/auto/qmltest/selftests/tst_destroy.qml
+++ b/tests/auto/qmltest/selftests/tst_destroy.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
TestCase {
id: testCase
diff --git a/tests/auto/qmltest/selftests/tst_findChild.qml b/tests/auto/qmltest/selftests/tst_findChild.qml
index 69bcb390e9..ae0b24e0de 100644
--- a/tests/auto/qmltest/selftests/tst_findChild.qml
+++ b/tests/auto/qmltest/selftests/tst_findChild.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "tst_findChild"
diff --git a/tests/auto/qmltest/selftests/tst_selftests.qml b/tests/auto/qmltest/selftests/tst_selftests.qml
index 5d91141429..167c21774a 100644
--- a/tests/auto/qmltest/selftests/tst_selftests.qml
+++ b/tests/auto/qmltest/selftests/tst_selftests.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests"
diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
index bbfa08f443..689f04aa04 100644
--- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
+++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
@@ -33,7 +33,7 @@
import QtQuick 2.2
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 100
diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
index 2042afa2c5..c04aab3c01 100644
--- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
+++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root
diff --git a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
index b00cfbc5f8..81aac5fb9e 100644
--- a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
@@ -34,7 +34,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 100
diff --git a/tests/auto/qmltest/shadersource/tst_SourceItem.qml b/tests/auto/qmltest/shadersource/tst_SourceItem.qml
index 822b53d6fa..bde6ce2a0b 100644
--- a/tests/auto/qmltest/shadersource/tst_SourceItem.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourceItem.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root
diff --git a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
index 4fb08a02f6..48f1f3ecc2 100644
--- a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
@@ -34,7 +34,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
Rectangle {
diff --git a/tests/auto/qmltest/stability/tst_unloadrepeater.qml b/tests/auto/qmltest/stability/tst_unloadrepeater.qml
index dfb631493b..62811ddabc 100644
--- a/tests/auto/qmltest/stability/tst_unloadrepeater.qml
+++ b/tests/auto/qmltest/stability/tst_unloadrepeater.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
width : 800
diff --git a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
index b05d5c67a9..e5fab06409 100644
--- a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
+++ b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_guardcondition.qml b/tests/auto/qmltest/statemachine/tst_guardcondition.qml
index 0390b5f8fa..abe348aa8d 100644
--- a/tests/auto/qmltest/statemachine/tst_guardcondition.qml
+++ b/tests/auto/qmltest/statemachine/tst_guardcondition.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_historystate.qml b/tests/auto/qmltest/statemachine/tst_historystate.qml
index 6e2aa70417..1da554c9bb 100644
--- a/tests/auto/qmltest/statemachine/tst_historystate.qml
+++ b/tests/auto/qmltest/statemachine/tst_historystate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_initialstate.qml b/tests/auto/qmltest/statemachine/tst_initialstate.qml
index c08b3f7001..a1fa6f2d55 100644
--- a/tests/auto/qmltest/statemachine/tst_initialstate.qml
+++ b/tests/auto/qmltest/statemachine/tst_initialstate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
index 443771f8f4..792ddd33bc 100644
--- a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
+++ b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
index f584b7cd01..f123f3f3af 100644
--- a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
+++ b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
index 2e3a5efdfd..1926b100b6 100644
--- a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
+++ b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_trafficlight.qml b/tests/auto/qmltest/statemachine/tst_trafficlight.qml
index 3f731a4014..6e2eebb354 100644
--- a/tests/auto/qmltest/statemachine/tst_trafficlight.qml
+++ b/tests/auto/qmltest/statemachine/tst_trafficlight.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/text/tst_text.qml b/tests/auto/qmltest/text/tst_text.qml
index b1d743f630..772d9987bc 100644
--- a/tests/auto/qmltest/text/tst_text.qml
+++ b/tests/auto/qmltest/text/tst_text.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/textedit/tst_textedit.qml b/tests/auto/qmltest/textedit/tst_textedit.qml
index 1dc7084049..a7fb2374b6 100644
--- a/tests/auto/qmltest/textedit/tst_textedit.qml
+++ b/tests/auto/qmltest/textedit/tst_textedit.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/textinput/tst_textinput.qml b/tests/auto/qmltest/textinput/tst_textinput.qml
index 9a00ac8a60..4942665e9d 100644
--- a/tests/auto/qmltest/textinput/tst_textinput.qml
+++ b/tests/auto/qmltest/textinput/tst_textinput.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
index 921c81ae89..e0ea57056a 100644
--- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
+++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
@@ -59,29 +59,6 @@
} \
} while (0)
-static int verifyHierarchy(QAccessibleInterface *iface)
-{
- int errorAt = 0;
- static int treelevel = 0; // for error diagnostics
- QAccessibleInterface *if2;
- ++treelevel;
- int middle = iface->childCount()/2 + 1;
- for (int i = 0; i < iface->childCount() && !errorAt; ++i) {
- if2 = iface->child(i);
- EXPECT(if2 != 0);
- // navigate Ancestor...
- QAccessibleInterface *parent = if2->parent();
- EXPECT(iface->object() == parent->object());
-
- // verify children...
- if (!errorAt)
- errorAt = verifyHierarchy(if2);
- }
-
- --treelevel;
- return errorAt;
-}
-
//TESTED_FILES=
@@ -383,8 +360,6 @@ void tst_QQuickAccessible::checkableTest()
QScopedPointer<QQuickView> window(new QQuickView());
window->setSource(testFileUrl("checkbuttons.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickItem *contentItem = window->contentItem();
QVERIFY(contentItem);
@@ -462,8 +437,6 @@ void tst_QQuickAccessible::ignoredTest()
QScopedPointer<QQuickView> window(new QQuickView());
window->setSource(testFileUrl("ignored.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickItem *contentItem = window->contentItem();
QVERIFY(contentItem);
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
index 92e27b9945..8374552974 100755
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
index 48c4fb734c..1a8ca81ba0 100755
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
index 7c4496b206..c5f9860fe2 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
index 1a17a1a908..87cba880af 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
index 59671f5145..4098af14f2 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
index 000888a36f..5be221042e 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Component {
id:canvas
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
index c8c2f4960f..b0cae69fe3 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
import QtQuick.Window 2.1
TestCase {
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
index b18250291e..f266c16d76 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
@@ -1,6 +1,6 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Canvas {
id: canvas
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
index 487f7dc903..281264ba92 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
CanvasTestCase {
id:testCase
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 26819ff48b..a3d902a054 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -91,12 +91,17 @@ private slots:
void stopAtBounds_data();
void nestedMouseAreaUsingTouch();
void pressDelayWithLoader();
+ void cleanup();
private:
void flickWithTouch(QQuickWindow *window, QTouchDevice *touchDevice, const QPoint &from, const QPoint &to);
- QQmlEngine engine;
};
+void tst_qquickflickable::cleanup()
+{
+ QVERIFY(QGuiApplication::topLevelWindows().isEmpty());
+}
+
void tst_qquickflickable::create()
{
QQmlEngine engine;
@@ -199,6 +204,7 @@ void tst_qquickflickable::properties()
void tst_qquickflickable::boundsBehavior()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -330,6 +336,7 @@ void tst_qquickflickable::rebound()
void tst_qquickflickable::maximumFlickVelocity()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -349,6 +356,7 @@ void tst_qquickflickable::maximumFlickVelocity()
void tst_qquickflickable::flickDeceleration()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -553,6 +561,7 @@ void tst_qquickflickable::nestedClickThenFlick()
void tst_qquickflickable::flickableDirection()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -1213,9 +1222,16 @@ void tst_qquickflickable::flickVelocity()
void tst_qquickflickable::margins()
{
- QQmlEngine engine;
- QQmlComponent c(&engine, testFileUrl("margins.qml"));
- QQuickItem *root = qobject_cast<QQuickItem*>(c.create());
+ QScopedPointer<QQuickView> window(new QQuickView);
+ window->setSource(testFileUrl("margins.qml"));
+ QTRY_COMPARE(window->status(), QQuickView::Ready);
+ QQuickViewTestUtil::centerOnScreen(window.data());
+ QQuickViewTestUtil::moveMouseAway(window.data());
+ window->setTitle(QTest::currentTestFunction());
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+ QQuickItem *root = window->rootObject();
+ QVERIFY(root);
QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(root);
QVERIFY(obj != 0);
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 99702236ee..478944c650 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -1558,7 +1558,7 @@ void tst_QQuickGridView::multipleChanges(bool condensed)
{
QList<QPair<QString, QString> > items;
for (int j=changes[i].index; j<changes[i].index + changes[i].count; ++j)
- items << qMakePair(QString("new item " + j), QString::number(j));
+ items << qMakePair(QString("new item %1").arg(j), QString::number(j));
model.insertItems(changes[i].index, items);
break;
}
diff --git a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
index c57cde5eda..c5fb53a3de 100644
--- a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
+++ b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 300
diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml
index e000d5c6fd..0e3f1d4b62 100644
--- a/tests/auto/quick/qquickwindow/data/windowattached.qml
+++ b/tests/auto/quick/qquickwindow/data/windowattached.qml
@@ -6,6 +6,7 @@ Rectangle {
width: 100
height: 100
property bool windowActive: root.Window.active
+ property Item contentItem: root.Window.contentItem
Text {
objectName: "rectangleWindowText"
anchors.centerIn: parent
@@ -20,6 +21,7 @@ Rectangle {
objectName: "extraWindowText"
anchors.centerIn: parent
text: (extraWindow.active ? "active" : "inactive") + "\nvisibility: " + Window.visibility
+ property Item contentItem: Window.contentItem
}
}
}
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 5bd7492d70..7c94cf6d17 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -341,6 +341,7 @@ private slots:
void testWindowVisibilityOrder();
void blockClosing();
+ void blockCloseMethod();
void crashWhenHoverItemDeleted();
@@ -1208,6 +1209,11 @@ void tst_qquickwindow::headless()
QVERIFY(window->openglContext() == 0);
}
+ if (QGuiApplication::platformName() == QLatin1String("windows")
+ && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
+ QSKIP("Crashes on Windows/ANGLE, QTBUG-42967");
+ }
+
// Destroy the native windowing system buffers
window->destroy();
QVERIFY(window->handle() == 0);
@@ -1739,6 +1745,25 @@ void tst_qquickwindow::blockClosing()
QTRY_VERIFY(!window->isVisible());
}
+void tst_qquickwindow::blockCloseMethod()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("ucantclosethis.qml"));
+ QQuickWindow *window = qobject_cast<QQuickWindow *>(component.create());
+ QVERIFY(window);
+ window->show();
+ QTest::qWaitForWindowExposed(window);
+ QVERIFY(window->isVisible());
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QVERIFY(window->isVisible());
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QVERIFY(window->isVisible());
+ window->setProperty("canCloseThis", true);
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QTRY_VERIFY(!window->isVisible());
+}
+
void tst_qquickwindow::crashWhenHoverItemDeleted()
{
// QTBUG-32771
@@ -1952,6 +1977,7 @@ void tst_qquickwindow::attachedProperty()
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(view.rootObject()->property("windowActive").toBool());
+ QCOMPARE(view.rootObject()->property("contentItem").value<QQuickItem*>(), view.contentItem());
QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow");
QVERIFY(innerWindow);
@@ -1961,6 +1987,7 @@ void tst_qquickwindow::attachedProperty()
QQuickText *text = view.rootObject()->findChild<QQuickText*>("extraWindowText");
QVERIFY(text);
QCOMPARE(text->text(), QLatin1String("active\nvisibility: 2"));
+ QCOMPARE(text->property("contentItem").value<QQuickItem*>(), innerWindow->contentItem());
}
class RenderJob : public QRunnable