aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-16 23:21:10 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-16 23:21:16 +0200
commit345226aa3ecee8642c3bf46e40c981d4a49d958e (patch)
treeeb49f01c70d239286cb3f08bbe677c47c640cd12 /tests
parent5149aa68eca6ede8836ec4f07a14d22d9da9b161 (diff)
parenta273a0ad9c1df7aed612ee6353753f668d545076 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
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/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp7
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp4
7 files changed, 62 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 3e8e1d23ea..36350e2d08 100644
--- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
+++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp
@@ -43,6 +43,7 @@ private slots:
void testLoadComplete();
void loadComponentSynchronously();
void trimCache();
+ void trimCache2();
};
void tst_QQMLTypeLoader::testLoadComplete()
@@ -107,6 +108,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/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 15d7ffd9d9..72cc76a855 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -1235,8 +1235,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();