on xenial help sign in
Fix the ShellWithPin test and some functionality.
35f1284Michał Sawicz
tests/qmltests/tst_ShellWithPin.qml+35−31
@@ -27,9 +27,10 @@ import Powerd 0.1
27
27
28import "../../qml"
28import "../../qml"
29
29
30−Row {
30+Item {
31 id: root
31 id: root
32− spacing: 0
32+ width: contentRow.width
33+ height: contentRow.height
33
34
34 QtObject {
35 QtObject {
35 id: applicationArguments
36 id: applicationArguments
@@ -47,34 +48,36 @@ Row {
47 }
48 }
48 }
49 }
49
50
50− Loader {
51+ Row {
51− id: shellLoader
52+ id: contentRow
52
53
53− width: units.gu(40)
54+ Loader {
54− height: units.gu(71)
55+ id: shellLoader
55
56
57+ width: units.gu(40)
58+ height: units.gu(71)
59+
56− property bool itemDestroyed: false
60+ property bool itemDestroyed: false
57− sourceComponent: Component {
61+ sourceComponent: Component {
58− Shell {
62+ Shell {
59− Component.onDestruction: {
63+ Component.onDestruction: {
60− shellLoader.itemDestroyed = true
64+ shellLoader.itemDestroyed = true
65+ }
66+ maxFailedLogins: maxRetriesTextField.text
61 }
67 }
62− maxFailedLogins: maxRetriesTextField.text
63 }
68 }
64 }
69 }
65− }
66
70
67− Rectangle {
71+ Rectangle {
68− color: "white"
72+ color: "white"
69− width: units.gu(30)
73+ width: units.gu(30)
70− height: shellLoader.height
74+ height: shellLoader.height
71
75
72− Column {
76+ Column {
73− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
77+ anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
74− spacing: units.gu(1)
78+ spacing: units.gu(1)
75− Row {
76− anchors { left: parent.left; right: parent.right }
77 Button {
79 Button {
80+ anchors { left: parent.left; right: parent.right }
78 text: "Show Greeter"
81 text: "Show Greeter"
79 onClicked: {
82 onClicked: {
80 if (shellLoader.status !== Loader.Ready)
83 if (shellLoader.status !== Loader.Ready)
@@ -86,15 +89,15 @@ Row {
86 }
89 }
87 }
90 }
88 }
91 }
89− }
90
92
91− Label {
93+ Label {
92− text: "Max retries:"
94+ text: "Max retries:"
93− color: "black"
95+ color: "black"
94− }
96+ }
95− TextField {
97+ TextField {
96− id: maxRetriesTextField
98+ id: maxRetriesTextField
97− text: "-1"
99+ text: "-1"
100+ }
98 }
101 }
99 }
102 }
100 }
103 }
@@ -111,6 +114,7 @@ Row {
111 }
114 }
112
115
113 UT.UnityTestCase {
116 UT.UnityTestCase {
117+ id: testCase
114 name: "ShellWithPin"
118 name: "ShellWithPin"
115 when: windowShown
119 when: windowShown
116
120
@@ -296,7 +300,7 @@ Row {
296
300
297 var dialog = findChild(root, "infoPopup")
301 var dialog = findChild(root, "infoPopup")
298 var button = findChild(dialog, "infoPopupOkButton")
302 var button = findChild(dialog, "infoPopupOkButton")
299− mouseClick(button, units.gu(1), units.gu(1))
303+ mouseClick(button, button.width / 2, button.height / 2)
300 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)
304 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)
301
305
302 tryCompare(resetSpy, "count", 0)
306 tryCompare(resetSpy, "count", 0)