aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-18 13:07:22 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-09-21 11:16:28 +0200
commit02b4770c3d867bf0b562db63015a7137479db10a (patch)
tree57157d0101a295fd394bf9acc91dd216fb361264 /tests
parent858c62583ff776edb8c9e539f0331f5d658de2d1 (diff)
parent345226aa3ecee8642c3bf46e40c981d4a49d958e (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/qml/qml/qqmltypeloader.cpp Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmltypeloader/data/MyComponent.qml11
-rw-r--r--tests/auto/qml/qqmltypeloader/data/MyComponent2.qml7
-rw-r--r--tests/auto/qml/qqmltypeloader/data/MyComponent3.qml9
-rw-r--r--tests/auto/qml/qqmltypeloader/data/trim_cache2.qml13
-rw-r--r--tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp14
-rw-r--r--tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml55
-rw-r--r--tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml53
-rw-r--r--tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml12
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp7
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp4
10 files changed, 182 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmltypeloader/data/MyComponent.qml b/tests/auto/qml/qqmltypeloader/data/MyComponent.qml
new file mode 100644
index 0000000000..a642518199
--- /dev/null
+++ b/tests/auto/qml/qqmltypeloader/data/MyComponent.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 62
+
+ MyComponent3 {}
+
+ MyComponent2 {}
+}
+
diff --git a/tests/auto/qml/qqmltypeloader/data/MyComponent2.qml b/tests/auto/qml/qqmltypeloader/data/MyComponent2.qml
new file mode 100644
index 0000000000..02cf5cb5dd
--- /dev/null
+++ b/tests/auto/qml/qqmltypeloader/data/MyComponent2.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 62
+}
+
diff --git a/tests/auto/qml/qqmltypeloader/data/MyComponent3.qml b/tests/auto/qml/qqmltypeloader/data/MyComponent3.qml
new file mode 100644
index 0000000000..ad5d569197
--- /dev/null
+++ b/tests/auto/qml/qqmltypeloader/data/MyComponent3.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 100
+ height: 62
+
+ MyComponent4 {}
+}
+
diff --git a/tests/auto/qml/qqmltypeloader/data/trim_cache2.qml b/tests/auto/qml/qqmltypeloader/data/trim_cache2.qml
new file mode 100644
index 0000000000..326a720a87
--- /dev/null
+++ b/tests/auto/qml/qqmltypeloader/data/trim_cache2.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+Item {
+ width: 400
+ height: 400
+
+ Component.onCompleted: {
+ var component = Qt.createComponent("MyComponent.qml")
+ if (component.status == Component.Error)
+ console.log(component.errorString())
+ }
+}
+
diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
index 74f3929783..3d3a7ff725 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -42,6 +42,7 @@ private slots:
void testLoadComplete();
void loadComponentSynchronously();
void trimCache();
+ void trimCache2();
};
void tst_QQMLTypeLoader::testLoadComplete()
@@ -106,6 +107,19 @@ void tst_QQMLTypeLoader::trimCache()
}
}
+void tst_QQMLTypeLoader::trimCache2()
+{
+ QQuickView *window = new QQuickView();
+ window->setSource(testFileUrl("trim_cache2.qml"));
+ QQmlTypeLoader &loader = QQmlEnginePrivate::get(window->engine())->typeLoader;
+ // in theory if gc has already run this could be false
+ // QCOMPARE(loader.isTypeLoaded(testFileUrl("MyComponent2.qml")), true);
+ window->engine()->collectGarbage();
+ QTest::qWait(1); // force event loop
+ window->engine()->trimComponentCache();
+ QCOMPARE(loader.isTypeLoaded(testFileUrl("MyComponent2.qml")), false);
+}
+
QTEST_MAIN(tst_QQMLTypeLoader)
#include "tst_qqmltypeloader.moc"
diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml
new file mode 100644
index 0000000000..22205c18f0
--- /dev/null
+++ b/tests/auto/quick/qquicklayouts/data/rowlayout/Container.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.7
+import QtQuick.Layouts 1.3
+
+Item {
+ objectName: "qtbug51927-window"
+ visible: true
+
+ default property alias _contents: customContent.data
+
+ RowLayout {
+ id: customContent
+ objectName: "qtbug51927-columnLayout"
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml
new file mode 100644
index 0000000000..ff7ce6221b
--- /dev/null
+++ b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.2
+
+Container {
+ visible: true
+
+ Text {
+ objectName: "qtbug51927-text"
+ text: qsTr("Hello World")
+ anchors.centerIn: parent
+ renderType: Text.QtRendering
+ }
+}
diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
index 33b8fd0e4e..2d4e227a9e 100644
--- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
+++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
@@ -926,5 +926,17 @@ Item {
waitForRendering(layout)
layout.destroy()
}
+
+
+ function test_defaultPropertyAliasCrash() {
+ var containerUserComponent = Qt.createComponent("rowlayout/ContainerUser.qml");
+ compare(containerUserComponent.status, Component.Ready);
+
+ var containerUser = containerUserComponent.createObject(testCase);
+ verify(containerUser);
+
+ // Shouldn't crash.
+ containerUser.destroy();
+ }
}
}
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 17c09805aa..cabfb97914 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -4094,9 +4094,10 @@ void tst_qquickvisualdatamodel::asynchronousRemove()
controller.incubateFor(50);
} while (timer.elapsed() < 1000 && controller.incubatingObjectCount() > 0);
- QVERIFY(requester.itemInitialized);
- QCOMPARE(requester.itemCreated, requester.itemInitialized);
- QCOMPARE(requester.itemDestroyed, requester.itemInitialized);
+ // The item was removed before incubation started. We should not have any item created.
+ QVERIFY(!requester.itemInitialized);
+ QVERIFY(!requester.itemCreated);
+ QVERIFY(!requester.itemDestroyed);
} else {
item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index baa4bcb21c..1594da46bd 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -1336,8 +1336,12 @@ void tst_TouchMouse::hoverEnabled()
// device->setType(QTouchDevice::TouchScreen);
// QWindowSystemInterface::registerTouchDevice(device);
+ // Ensure the cursor is away from the window
+ QCursor::setPos(0, 0);
+
QQuickView *window = createView();
window->setSource(testFileUrl("hoverMouseAreas.qml"));
+ window->setPosition(10, 10);
window->show();
window->requestActivate();