Merge lp:~jonas-drange/ubuntu-settings-components/apl into lp:ubuntu-settings-components
- apl
- Merge into trunk
Proposed by
Jonas G. Drange
Status: | Merged |
---|---|
Approved by: | Nick Dedekind |
Approved revision: | 181 |
Merged at revision: | 179 |
Proposed branch: | lp:~jonas-drange/ubuntu-settings-components/apl |
Merge into: | lp:ubuntu-settings-components |
Diff against target: |
418 lines (+206/-15) 7 files modified
debian/changelog (+7/-0) plugins/Ubuntu/Settings/Fingerprint/Fingerprint.qml (+3/-1) plugins/Ubuntu/Settings/Fingerprint/Fingerprints.qml (+42/-5) plugins/Ubuntu/Settings/Fingerprint/Setup.qml (+3/-5) plugins/Ubuntu/Settings/Vpn/VpnEditor.qml (+3/-2) tests/qmltests/Fingerprint/tst_FingerprintNames.qml (+18/-0) tests/qmltests/Fingerprint/tst_Fingerprints.qml (+130/-2) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-settings-components/apl |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nick Dedekind (community) | Approve | ||
Review via email: mp+313432@code.launchpad.net |
Commit message
Description of the change
* Fix issues discovered when migrating USS to APL.
* Bump version so as to allow USS to complete the migration.
To post a comment you must log in.
- 178. By Jonas G. Drange
-
syncs with trunk
- 179. By Jonas G. Drange
-
drops parentpage, unused variable
- 180. By Jonas G. Drange
-
clarifies changes
- 181. By Jonas G. Drange
-
fixes typos in Fingerprint
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2016-12-01 00:34:17 +0000 | |||
3 | +++ debian/changelog 2016-12-19 15:01:27 +0000 | |||
4 | @@ -1,3 +1,10 @@ | |||
5 | 1 | ubuntu-settings-components (0.12+17.04.20161123-0ubuntu2) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | * Allows Fingerprint and VPN modules to work well with APL and pagestacks. | ||
8 | 4 | * Bumps version to 0.12 so that consumers can migrate to APL safely. | ||
9 | 5 | |||
10 | 6 | -- Jonas G. Drange <jonas.drange@canonical.com> Fri, 16 Dec 2016 14:16:24 +0100 | ||
11 | 7 | |||
12 | 1 | ubuntu-settings-components (0.11+17.04.20161201-0ubuntu1) zesty; urgency=medium | 8 | ubuntu-settings-components (0.11+17.04.20161201-0ubuntu1) zesty; urgency=medium |
13 | 2 | 9 | ||
14 | 3 | * dateExt: take care of the numbers of days in month when adding | 10 | * dateExt: take care of the numbers of days in month when adding |
15 | 4 | 11 | ||
16 | === modified file 'plugins/Ubuntu/Settings/Fingerprint/Fingerprint.qml' | |||
17 | --- plugins/Ubuntu/Settings/Fingerprint/Fingerprint.qml 2016-06-15 10:45:27 +0000 | |||
18 | +++ plugins/Ubuntu/Settings/Fingerprint/Fingerprint.qml 2016-12-19 15:01:27 +0000 | |||
19 | @@ -23,11 +23,13 @@ | |||
20 | 23 | 23 | ||
21 | 24 | Page { | 24 | Page { |
22 | 25 | id: root | 25 | id: root |
23 | 26 | objectName: "fingerprintItemPage" | ||
24 | 26 | property string name | 27 | property string name |
25 | 27 | property string templateId | 28 | property string templateId |
26 | 28 | 29 | ||
27 | 29 | signal requestDeletion(string templateId) | 30 | signal requestDeletion(string templateId) |
28 | 30 | signal requestRename(string templateId, string name) | 31 | signal requestRename(string templateId, string name) |
29 | 32 | signal done() | ||
30 | 31 | 33 | ||
31 | 32 | function deletionFailed() { | 34 | function deletionFailed() { |
32 | 33 | PopupUtils.open(deletionFailed); | 35 | PopupUtils.open(deletionFailed); |
33 | @@ -96,7 +98,7 @@ | |||
34 | 96 | onAccepted: { | 98 | onAccepted: { |
35 | 97 | if (text) { | 99 | if (text) { |
36 | 98 | requestRename(templateId, text); | 100 | requestRename(templateId, text); |
38 | 99 | pageStack.pop(); | 101 | done(); |
39 | 100 | } | 102 | } |
40 | 101 | } | 103 | } |
41 | 102 | } | 104 | } |
42 | 103 | 105 | ||
43 | === modified file 'plugins/Ubuntu/Settings/Fingerprint/Fingerprints.qml' | |||
44 | --- plugins/Ubuntu/Settings/Fingerprint/Fingerprints.qml 2016-06-16 20:31:12 +0000 | |||
45 | +++ plugins/Ubuntu/Settings/Fingerprint/Fingerprints.qml 2016-12-19 15:01:27 +0000 | |||
46 | @@ -107,6 +107,31 @@ | |||
47 | 107 | } | 107 | } |
48 | 108 | } | 108 | } |
49 | 109 | 109 | ||
50 | 110 | // Pushes onto a pageStack or an APL. | ||
51 | 111 | function pushShim(page, opts) { | ||
52 | 112 | var incubator; | ||
53 | 113 | if (typeof opts === 'undefined') | ||
54 | 114 | opts = {}; | ||
55 | 115 | if (pageStack.push) { | ||
56 | 116 | return pageStack.push(page, opts); | ||
57 | 117 | } else { | ||
58 | 118 | page = Qt.createComponent(page); | ||
59 | 119 | incubator = pageStack.addPageToNextColumn(root, page, opts); | ||
60 | 120 | incubator.forceCompletion(); | ||
61 | 121 | return incubator.object; | ||
62 | 122 | } | ||
63 | 123 | } | ||
64 | 124 | |||
65 | 125 | /* Pops a pageStack or APL. The page argument is only effective if the | ||
66 | 126 | pageStack is an APL, in which case all child pages of page are removed. */ | ||
67 | 127 | function popShim(page) { | ||
68 | 128 | if (pageStack.pop) { | ||
69 | 129 | pageStack.pop(); | ||
70 | 130 | } else { | ||
71 | 131 | pageStack.removePages(page); | ||
72 | 132 | } | ||
73 | 133 | } | ||
74 | 134 | |||
75 | 110 | signal requestPasscode() | 135 | signal requestPasscode() |
76 | 111 | 136 | ||
77 | 112 | Component.onCompleted: { | 137 | Component.onCompleted: { |
78 | @@ -231,7 +256,7 @@ | |||
79 | 231 | 256 | ||
80 | 232 | ListItem { | 257 | ListItem { |
81 | 233 | height: fpLayout.height + (divider.visible ? divider.height : 0) | 258 | height: fpLayout.height + (divider.visible ? divider.height : 0) |
83 | 234 | onClicked: _fpInstancePage = pageStack.push( | 259 | onClicked: _fpInstancePage = pushShim( |
84 | 235 | Qt.resolvedUrl("Fingerprint.qml"), { | 260 | Qt.resolvedUrl("Fingerprint.qml"), { |
85 | 236 | name: modelData.name, | 261 | name: modelData.name, |
86 | 237 | templateId: modelData.templateId | 262 | templateId: modelData.templateId |
87 | @@ -261,7 +286,7 @@ | |||
88 | 261 | ListItem { | 286 | ListItem { |
89 | 262 | height: addFpLayout.height + (divider.visible ? divider.height : 0) | 287 | height: addFpLayout.height + (divider.visible ? divider.height : 0) |
90 | 263 | onClicked: { | 288 | onClicked: { |
92 | 264 | _setupPage = pageStack.push(Qt.resolvedUrl("Setup.qml")); | 289 | _setupPage = pushShim(Qt.resolvedUrl("Setup.qml")); |
93 | 265 | root.enroll(); | 290 | root.enroll(); |
94 | 266 | } | 291 | } |
95 | 267 | enabled: parent.enabled | 292 | enabled: parent.enabled |
96 | @@ -342,7 +367,11 @@ | |||
97 | 342 | Connections { | 367 | Connections { |
98 | 343 | target: _setupPage | 368 | target: _setupPage |
99 | 344 | onEnroll: root.enroll() | 369 | onEnroll: root.enroll() |
101 | 345 | onCancel: root.cancel() | 370 | onCancel: { |
102 | 371 | root.cancel(); | ||
103 | 372 | popShim(root); | ||
104 | 373 | } | ||
105 | 374 | onDone: popShim(root) | ||
106 | 346 | } | 375 | } |
107 | 347 | 376 | ||
108 | 348 | Connections { | 377 | Connections { |
109 | @@ -353,6 +382,7 @@ | |||
110 | 353 | _removalOperation.start(removalObserver); | 382 | _removalOperation.start(removalObserver); |
111 | 354 | } | 383 | } |
112 | 355 | onRequestRename: renameTemplate(templateId, name) | 384 | onRequestRename: renameTemplate(templateId, name) |
113 | 385 | onDone: popShim(root) | ||
114 | 356 | } | 386 | } |
115 | 357 | 387 | ||
116 | 358 | Observer { | 388 | Observer { |
117 | @@ -404,8 +434,15 @@ | |||
118 | 404 | onCanceled: _removalOperation = null | 434 | onCanceled: _removalOperation = null |
119 | 405 | onSucceeded: { | 435 | onSucceeded: { |
120 | 406 | _removalOperation = null; | 436 | _removalOperation = null; |
123 | 407 | if (pageStack.currentPage === _fpInstancePage) | 437 | /* If we have a currentPage, pop one page. If not, pop every child |
124 | 408 | pageStack.pop(); | 438 | of root. */ |
125 | 439 | if (pageStack.currentPage) { | ||
126 | 440 | if (pageStack.currentPage === _fpInstancePage) { | ||
127 | 441 | popShim(); | ||
128 | 442 | } | ||
129 | 443 | } else { | ||
130 | 444 | popShim(root); | ||
131 | 445 | } | ||
132 | 409 | root.removeTemplate(result); | 446 | root.removeTemplate(result); |
133 | 410 | } | 447 | } |
134 | 411 | } | 448 | } |
135 | 412 | 449 | ||
136 | === modified file 'plugins/Ubuntu/Settings/Fingerprint/Setup.qml' | |||
137 | --- plugins/Ubuntu/Settings/Fingerprint/Setup.qml 2016-07-12 12:32:18 +0000 | |||
138 | +++ plugins/Ubuntu/Settings/Fingerprint/Setup.qml 2016-12-19 15:01:27 +0000 | |||
139 | @@ -29,6 +29,7 @@ | |||
140 | 29 | 29 | ||
141 | 30 | signal enroll() | 30 | signal enroll() |
142 | 31 | signal cancel() | 31 | signal cancel() |
143 | 32 | signal done() | ||
144 | 32 | 33 | ||
145 | 33 | function enrollmentFailed(error) { | 34 | function enrollmentFailed(error) { |
146 | 34 | root.state = "failed"; | 35 | root.state = "failed"; |
147 | @@ -346,10 +347,7 @@ | |||
148 | 346 | } | 347 | } |
149 | 347 | height: parent.height | 348 | height: parent.height |
150 | 348 | width: units.gu(10) | 349 | width: units.gu(10) |
155 | 349 | onClicked: { | 350 | onClicked: root.cancel() |
152 | 350 | root.cancel(); | ||
153 | 351 | pageStack.pop(); | ||
154 | 352 | } | ||
156 | 353 | 351 | ||
157 | 354 | Label { | 352 | Label { |
158 | 355 | id: cancelButtonText | 353 | id: cancelButtonText |
159 | @@ -370,7 +368,7 @@ | |||
160 | 370 | enabled: false | 368 | enabled: false |
161 | 371 | height: parent.height | 369 | height: parent.height |
162 | 372 | width: units.gu(10) | 370 | width: units.gu(10) |
164 | 373 | onClicked: pageStack.pop() | 371 | onClicked: root.done() |
165 | 374 | 372 | ||
166 | 375 | Label { | 373 | Label { |
167 | 376 | id: doneButtonText | 374 | id: doneButtonText |
168 | 377 | 375 | ||
169 | === modified file 'plugins/Ubuntu/Settings/Vpn/VpnEditor.qml' | |||
170 | --- plugins/Ubuntu/Settings/Vpn/VpnEditor.qml 2016-04-27 12:30:12 +0000 | |||
171 | +++ plugins/Ubuntu/Settings/Vpn/VpnEditor.qml 2016-12-19 15:01:27 +0000 | |||
172 | @@ -31,6 +31,7 @@ | |||
173 | 31 | 31 | ||
174 | 32 | signal typeChanged(var connection, int type) | 32 | signal typeChanged(var connection, int type) |
175 | 33 | signal reconnectionPrompt() | 33 | signal reconnectionPrompt() |
176 | 34 | signal done() | ||
177 | 34 | 35 | ||
178 | 35 | function commit () { | 36 | function commit () { |
179 | 36 | editorLoader.item.state = 'committing'; | 37 | editorLoader.item.state = 'committing'; |
180 | @@ -137,7 +138,7 @@ | |||
181 | 137 | if (editor.isNew) { | 138 | if (editor.isNew) { |
182 | 138 | connection.remove(); | 139 | connection.remove(); |
183 | 139 | } | 140 | } |
185 | 140 | pageStack.pop(); | 141 | done(); |
186 | 141 | } | 142 | } |
187 | 142 | Layout.fillWidth: true | 143 | Layout.fillWidth: true |
188 | 143 | } | 144 | } |
189 | @@ -187,7 +188,7 @@ | |||
190 | 187 | if (connection.active) { | 188 | if (connection.active) { |
191 | 188 | editor.reconnectionPrompt(); | 189 | editor.reconnectionPrompt(); |
192 | 189 | } | 190 | } |
194 | 190 | pageStack.pop(); | 191 | done(); |
195 | 191 | } | 192 | } |
196 | 192 | } | 193 | } |
197 | 193 | } | 194 | } |
198 | 194 | 195 | ||
199 | === modified file 'tests/qmltests/Fingerprint/tst_FingerprintNames.qml' | |||
200 | --- tests/qmltests/Fingerprint/tst_FingerprintNames.qml 2016-08-17 11:11:24 +0000 | |||
201 | +++ tests/qmltests/Fingerprint/tst_FingerprintNames.qml 2016-12-19 15:01:27 +0000 | |||
202 | @@ -279,6 +279,11 @@ | |||
203 | 279 | signalName: "requestRename" | 279 | signalName: "requestRename" |
204 | 280 | } | 280 | } |
205 | 281 | 281 | ||
206 | 282 | SignalSpy { | ||
207 | 283 | id: doneSpy | ||
208 | 284 | signalName: "done" | ||
209 | 285 | } | ||
210 | 286 | |||
211 | 282 | UbuntuTestCase { | 287 | UbuntuTestCase { |
212 | 283 | name: "TestTemplate" | 288 | name: "TestTemplate" |
213 | 284 | when: windowShown | 289 | when: windowShown |
214 | @@ -310,11 +315,13 @@ | |||
215 | 310 | pageStack.push(templateInstance); | 315 | pageStack.push(templateInstance); |
216 | 311 | requestRenameSpy.target = templateInstance; | 316 | requestRenameSpy.target = templateInstance; |
217 | 312 | requestDeletionSpy.target = templateInstance; | 317 | requestDeletionSpy.target = templateInstance; |
218 | 318 | doneSpy.target = templateInstance; | ||
219 | 313 | } | 319 | } |
220 | 314 | 320 | ||
221 | 315 | function cleanup() { | 321 | function cleanup() { |
222 | 316 | requestRenameSpy.clear(); | 322 | requestRenameSpy.clear(); |
223 | 317 | requestDeletionSpy.clear(); | 323 | requestDeletionSpy.clear(); |
224 | 324 | doneSpy.clear(); | ||
225 | 318 | pageStack.pop(); | 325 | pageStack.pop(); |
226 | 319 | templateInstance.destroy(); | 326 | templateInstance.destroy(); |
227 | 320 | templateInstance = null; | 327 | templateInstance = null; |
228 | @@ -347,6 +354,17 @@ | |||
229 | 347 | compare(requestRenameSpy.signalArguments[0][1], "Your finger"); | 354 | compare(requestRenameSpy.signalArguments[0][1], "Your finger"); |
230 | 348 | } | 355 | } |
231 | 349 | 356 | ||
232 | 357 | function test_requestDone() { | ||
233 | 358 | templateInstance.templateId = "tmplId"; | ||
234 | 359 | templateInstance.name = "My finger"; | ||
235 | 360 | |||
236 | 361 | getNameInput().text = "Your finger"; | ||
237 | 362 | getNameInput().accepted(); | ||
238 | 363 | doneSpy.wait(); | ||
239 | 364 | |||
240 | 365 | compare(doneSpy.count, 1); | ||
241 | 366 | } | ||
242 | 367 | |||
243 | 350 | function test_deletionFailed() { | 368 | function test_deletionFailed() { |
244 | 351 | templateInstance.deletionFailed(); | 369 | templateInstance.deletionFailed(); |
245 | 352 | tryCompareFunction(function () { | 370 | tryCompareFunction(function () { |
246 | 353 | 371 | ||
247 | === modified file 'tests/qmltests/Fingerprint/tst_Fingerprints.qml' | |||
248 | --- tests/qmltests/Fingerprint/tst_Fingerprints.qml 2016-08-17 11:56:24 +0000 | |||
249 | +++ tests/qmltests/Fingerprint/tst_Fingerprints.qml 2016-12-19 15:01:27 +0000 | |||
250 | @@ -18,6 +18,7 @@ | |||
251 | 18 | 18 | ||
252 | 19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
253 | 20 | import QtTest 1.0 | 20 | import QtTest 1.0 |
254 | 21 | import Ubuntu.Components 1.3 | ||
255 | 21 | import Ubuntu.Test 0.1 | 22 | import Ubuntu.Test 0.1 |
256 | 22 | import Ubuntu.Settings.Fingerprint 0.1 | 23 | import Ubuntu.Settings.Fingerprint 0.1 |
257 | 23 | import Biometryd 0.0 | 24 | import Biometryd 0.0 |
258 | @@ -29,6 +30,16 @@ | |||
259 | 29 | height: units.gu(90) | 30 | height: units.gu(90) |
260 | 30 | 31 | ||
261 | 31 | Component { | 32 | Component { |
262 | 33 | id: testPageStackComponent | ||
263 | 34 | PageStack {} | ||
264 | 35 | } | ||
265 | 36 | |||
266 | 37 | Component { | ||
267 | 38 | id: testAplComponent | ||
268 | 39 | AdaptivePageLayout {} | ||
269 | 40 | } | ||
270 | 41 | |||
271 | 42 | Component { | ||
272 | 32 | id: fingerprintsComponent | 43 | id: fingerprintsComponent |
273 | 33 | 44 | ||
274 | 34 | Fingerprints { | 45 | Fingerprints { |
275 | @@ -44,18 +55,21 @@ | |||
276 | 44 | name: "Fingerprints" | 55 | name: "Fingerprints" |
277 | 45 | when: windowShown | 56 | when: windowShown |
278 | 46 | 57 | ||
279 | 58 | property var testPageStack: null | ||
280 | 47 | property var fingerprintsInstance: null | 59 | property var fingerprintsInstance: null |
281 | 48 | 60 | ||
282 | 49 | function init() { | 61 | function init() { |
283 | 50 | Biometryd.setAvailable(true); | 62 | Biometryd.setAvailable(true); |
285 | 51 | fingerprintsInstance = fingerprintsComponent.createObject(testRoot); | 63 | testPageStack = testPageStackComponent.createObject(testRoot); |
286 | 64 | fingerprintsInstance = testPageStack.push(fingerprintsComponent); | ||
287 | 52 | } | 65 | } |
288 | 53 | 66 | ||
289 | 54 | function cleanup() { | 67 | function cleanup() { |
290 | 55 | spy.clear(); | 68 | spy.clear(); |
291 | 56 | spy.target = null; | 69 | spy.target = null; |
292 | 57 | spy.signalName = ""; | 70 | spy.signalName = ""; |
294 | 58 | fingerprintsInstance.destroy(); | 71 | testPageStack.pop(); |
295 | 72 | testPageStack.destroy(); | ||
296 | 59 | GSettingsController.setFingerprintNames({}); | 73 | GSettingsController.setFingerprintNames({}); |
297 | 60 | } | 74 | } |
298 | 61 | 75 | ||
299 | @@ -226,5 +240,119 @@ | |||
300 | 226 | return GSettingsController.fingerprintNames()["tmplId"]; | 240 | return GSettingsController.fingerprintNames()["tmplId"]; |
301 | 227 | }, targetFingerprintName); | 241 | }, targetFingerprintName); |
302 | 228 | } | 242 | } |
303 | 243 | |||
304 | 244 | function test_goToSetup() { | ||
305 | 245 | var btn = getSetupEntry(); | ||
306 | 246 | fingerprintsInstance.passcodeSet = true; | ||
307 | 247 | mouseClick(btn, btn.width / 2, btn.height / 2); | ||
308 | 248 | compare(testPageStack.currentPage.objectName, "fingerprintSetupPage"); | ||
309 | 249 | |||
310 | 250 | // Go back | ||
311 | 251 | testPageStack.currentPage.done(); | ||
312 | 252 | compare(testPageStack.currentPage, fingerprintsInstance); | ||
313 | 253 | } | ||
314 | 254 | |||
315 | 255 | function test_goToFingerprint() { | ||
316 | 256 | var obs = getEnrollmentObserver(); | ||
317 | 257 | var btn; | ||
318 | 258 | |||
319 | 259 | // Prerequisites for test: | ||
320 | 260 | fingerprintsInstance.passcodeSet = true; | ||
321 | 261 | obs.mockEnroll("tmplId", ""); | ||
322 | 262 | |||
323 | 263 | btn = findChild(fingerprintsInstance, "fingerprintInstance-0"); | ||
324 | 264 | waitForRendering(btn); | ||
325 | 265 | mouseClick(btn, btn.width / 2, btn.height / 2); | ||
326 | 266 | tryCompareFunction(function () { | ||
327 | 267 | return !!findChild(testRoot, "fingerprintItemPage"); | ||
328 | 268 | }, true); | ||
329 | 269 | |||
330 | 270 | // Go back | ||
331 | 271 | testPageStack.currentPage.done(); | ||
332 | 272 | compare(testPageStack.currentPage, fingerprintsInstance); | ||
333 | 273 | } | ||
334 | 274 | } | ||
335 | 275 | |||
336 | 276 | |||
337 | 277 | UbuntuTestCase { | ||
338 | 278 | name: "FingerprintsAdaptivePageLayout" | ||
339 | 279 | when: windowShown | ||
340 | 280 | |||
341 | 281 | Component { | ||
342 | 282 | id: pageComponent | ||
343 | 283 | Page { | ||
344 | 284 | header: PageHeader {} | ||
345 | 285 | } | ||
346 | 286 | } | ||
347 | 287 | |||
348 | 288 | property var testApl: null | ||
349 | 289 | property var fingerprintsInstance: null | ||
350 | 290 | |||
351 | 291 | function waitFor(objectName) { | ||
352 | 292 | tryCompareFunction(function () { | ||
353 | 293 | return !!findChild(testRoot, objectName); | ||
354 | 294 | }, true); | ||
355 | 295 | } | ||
356 | 296 | |||
357 | 297 | function waitForDestruction(objectName) { | ||
358 | 298 | tryCompareFunction(function () { | ||
359 | 299 | return !!findChild(testRoot, objectName); | ||
360 | 300 | }, false); | ||
361 | 301 | } | ||
362 | 302 | |||
363 | 303 | function init() { | ||
364 | 304 | var incubator; | ||
365 | 305 | Biometryd.setAvailable(true); | ||
366 | 306 | testApl = testAplComponent.createObject(testRoot, { | ||
367 | 307 | primaryPageSource: pageComponent | ||
368 | 308 | }); | ||
369 | 309 | |||
370 | 310 | // Wait until the primaryPage has been created. | ||
371 | 311 | tryCompareFunction(function () { | ||
372 | 312 | return !!testApl.primaryPage | ||
373 | 313 | }, true); | ||
374 | 314 | |||
375 | 315 | // Synchronously create the fingerprint instance on the APL. | ||
376 | 316 | incubator = testApl.addPageToNextColumn( | ||
377 | 317 | testApl.primaryPage, fingerprintsComponent | ||
378 | 318 | ); | ||
379 | 319 | incubator.forceCompletion(); | ||
380 | 320 | fingerprintsInstance = incubator.object; | ||
381 | 321 | waitForRendering(fingerprintsInstance) | ||
382 | 322 | } | ||
383 | 323 | |||
384 | 324 | function cleanup() { | ||
385 | 325 | testApl.removePages(testApl.primaryPage); | ||
386 | 326 | testApl.destroy(); | ||
387 | 327 | } | ||
388 | 328 | |||
389 | 329 | function test_goToSetup() { | ||
390 | 330 | var btn = findChild(fingerprintsInstance, "fingerprintSetupEntry");; | ||
391 | 331 | fingerprintsInstance.passcodeSet = true; | ||
392 | 332 | mouseClick(btn, btn.width / 2, btn.height / 2); | ||
393 | 333 | waitFor("fingerprintSetupPage"); | ||
394 | 334 | |||
395 | 335 | // Go back out | ||
396 | 336 | findChild(testRoot, "fingerprintSetupPage").done(); | ||
397 | 337 | waitForDestruction("fingerprintSetupPage"); | ||
398 | 338 | } | ||
399 | 339 | |||
400 | 340 | function test_goToFingerprint() { | ||
401 | 341 | var obs = findInvisibleChild(fingerprintsInstance, "enrollmentObserver"); | ||
402 | 342 | var btn; | ||
403 | 343 | |||
404 | 344 | // Prerequisites for test: | ||
405 | 345 | fingerprintsInstance.passcodeSet = true; | ||
406 | 346 | obs.mockEnroll("tmplId", ""); | ||
407 | 347 | |||
408 | 348 | btn = findChild(fingerprintsInstance, "fingerprintInstance-0"); | ||
409 | 349 | waitForRendering(btn); | ||
410 | 350 | mouseClick(btn, btn.width / 2, btn.height / 2); | ||
411 | 351 | waitFor("fingerprintItemPage"); | ||
412 | 352 | |||
413 | 353 | // Go back out. | ||
414 | 354 | findChild(testRoot, "fingerprintItemPage").done(); | ||
415 | 355 | waitForDestruction("fingerprintItemPage"); | ||
416 | 356 | } | ||
417 | 229 | } | 357 | } |
418 | 230 | } | 358 | } |
Looks ok