on xenial help sign in
Fix the ShellWithPin test and some functionality.

Top element can't be a positioner because popups and such anchor to it, breaking badly.

commit35f1284581e285b7fec4ffb56110991a7380aec7 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 10 Oct 2014, 11:18 (12 years ago) parentcc50056
1 file changed+35−31
tests/qmltests/tst_ShellWithPin.qml+35−31
tests/qmltests/tst_ShellWithPin.qml+35−31
@@ -27,9 +27,10 @@ import Powerd 0.1
2727
2828import "../../qml"
2929
30−Row {
30+Item {
3131 id: root
32− spacing: 0
32+ width: contentRow.width
33+ height: contentRow.height
3334
3435 QtObject {
3536 id: applicationArguments
@@ -47,34 +48,36 @@ Row {
4748 }
4849 }
4950
50− Loader {
51− id: shellLoader
51+ Row {
52+ id: contentRow
5253
53− width: units.gu(40)
54− height: units.gu(71)
54+ Loader {
55+ id: shellLoader
5556
56− property bool itemDestroyed: false
57− sourceComponent: Component {
58− Shell {
59− Component.onDestruction: {
60− shellLoader.itemDestroyed = true
57+ width: units.gu(40)
58+ height: units.gu(71)
59+
60+ property bool itemDestroyed: false
61+ sourceComponent: Component {
62+ Shell {
63+ Component.onDestruction: {
64+ shellLoader.itemDestroyed = true
65+ }
66+ maxFailedLogins: maxRetriesTextField.text
6167 }
62− maxFailedLogins: maxRetriesTextField.text
6368 }
6469 }
65− }
6670
67− Rectangle {
68− color: "white"
69− width: units.gu(30)
70− height: shellLoader.height
71+ Rectangle {
72+ color: "white"
73+ width: units.gu(30)
74+ height: shellLoader.height
7175
72− Column {
73− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
74− spacing: units.gu(1)
75− Row {
76− anchors { left: parent.left; right: parent.right }
76+ Column {
77+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
78+ spacing: units.gu(1)
7779 Button {
80+ anchors { left: parent.left; right: parent.right }
7881 text: "Show Greeter"
7982 onClicked: {
8083 if (shellLoader.status !== Loader.Ready)
@@ -86,15 +89,15 @@ Row {
8689 }
8790 }
8891 }
89− }
9092
91− Label {
92− text: "Max retries:"
93− color: "black"
94− }
95− TextField {
96− id: maxRetriesTextField
97− text: "-1"
93+ Label {
94+ text: "Max retries:"
95+ color: "black"
96+ }
97+ TextField {
98+ id: maxRetriesTextField
99+ text: "-1"
100+ }
98101 }
99102 }
100103 }
@@ -111,6 +114,7 @@ Row {
111114 }
112115
113116 UT.UnityTestCase {
117+ id: testCase
114118 name: "ShellWithPin"
115119 when: windowShown
116120
@@ -296,7 +300,7 @@ Row {
296300
297301 var dialog = findChild(root, "infoPopup")
298302 var button = findChild(dialog, "infoPopupOkButton")
299− mouseClick(button, units.gu(1), units.gu(1))
303+ mouseClick(button, button.width / 2, button.height / 2)
300304 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)
301305
302306 tryCompare(resetSpy, "count", 0)