aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@luxoft.com>2018-11-08 12:58:22 +0100
committerBramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>2018-11-09 13:17:17 +0000
commit3b316c1b1420fd4bfa178ebb0c0c5db56f54d5f0 (patch)
treef76091a17d9f6e93d08e467b479ab0fe0c3f24a9 /tests
parentd345f46a44648b9623a8c1857ea30505446cff4a (diff)
[tests] Update mocks in qml tests according to current APIs
Change-Id: I0c894659474692c4bc948b19ad2c112fb9252e20 Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/dummyimports/QtApplicationManager/SystemUI/WindowItem.qml14
-rw-r--r--tests/qmltests/FakeAppInfo.qml2
-rw-r--r--tests/qmltests/tst_WidgetGrid.qml15
3 files changed, 27 insertions, 4 deletions
diff --git a/tests/dummyimports/QtApplicationManager/SystemUI/WindowItem.qml b/tests/dummyimports/QtApplicationManager/SystemUI/WindowItem.qml
index 6fd261ec..d66f513c 100644
--- a/tests/dummyimports/QtApplicationManager/SystemUI/WindowItem.qml
+++ b/tests/dummyimports/QtApplicationManager/SystemUI/WindowItem.qml
@@ -32,7 +32,19 @@
import QtQuick 2.6
Item {
- property var window: null
+ id: root
+
+ property Item window
+ onWindowChanged: {
+ if (window) {
+ window.parent = root;
+ window.x = 0;
+ window.y = 0;
+ window.width = Qt.binding(function() { return root.width; });
+ window.height = Qt.binding(function() { return root.height; });
+ }
+ }
+
property bool primary: true
property bool objectFollowsItemSize: true
diff --git a/tests/qmltests/FakeAppInfo.qml b/tests/qmltests/FakeAppInfo.qml
index d83fecc2..17df2604 100644
--- a/tests/qmltests/FakeAppInfo.qml
+++ b/tests/qmltests/FakeAppInfo.qml
@@ -52,4 +52,6 @@ QtObject {
property bool asWidget: true
property var categories: ["widget"]
+
+ property bool windowPerfMonitorEnabled: false
}
diff --git a/tests/qmltests/tst_WidgetGrid.qml b/tests/qmltests/tst_WidgetGrid.qml
index f4392345..3054d8a3 100644
--- a/tests/qmltests/tst_WidgetGrid.qml
+++ b/tests/qmltests/tst_WidgetGrid.qml
@@ -44,18 +44,27 @@ Item {
FakeAppInfo {
id: redApp
- property Item window: Rectangle { color: "red" }
+ property Item window: Rectangle {
+ color: "red"
+ function setWindowProperty(name, value) {}
+ }
}
FakeAppInfo {
id: greenApp
- property Item window: Rectangle { color: "green" }
+ property Item window: Rectangle {
+ color: "green"
+ function setWindowProperty(name, value) {}
+ }
property int heightRows: 2
}
FakeAppInfo {
id: blueApp
- property Item window: Rectangle { color: "blue" }
+ property Item window: Rectangle {
+ color: "blue"
+ function setWindowProperty(name, value) {}
+ }
property int heightRows: 2
}