@@ -269,7 +269,7 @@ Item {
269269
270270 property list<Notification> nlist: [
271271 Notification {
272− nid: index++
272+ nid: 1
273273 type: Notification.SnapDecision
274274 hints: {"x-canonical-private-affirmative-tint": "true"}
275275 summary: "Theatre at Ferria Stadium"
@@ -280,9 +280,9 @@ Item {
280280 rawActions: ["ok_id", "Ok",
281281 "snooze_id", "Snooze",
282282 "view_id", "View"]
283− }/*,
283+ },
284284 Notification {
285− nid: index++
285+ nid: 2
286286 type: Notification.Ephemeral
287287 summary: "Photo upload completed"
288288 body: ""
@@ -292,7 +292,7 @@ Item {
292292 rawActions: []
293293 },
294294 Notification {
295− nid: index++
295+ nid: 3
296296 type: Notification.Ephemeral
297297 hints: {"x-canonical-private-affirmative-tint": "false",
298298 "sound-file": "dummy.ogg",
@@ -305,7 +305,7 @@ Item {
305305 rawActions: []
306306 },
307307 Notification {
308− nid: index++
308+ nid: 4
309309 type: Notification.Interactive
310310 hints: {"x-canonical-private-affirmative-tint": "false",
311311 "sound-file": "dummy.ogg"}
@@ -317,7 +317,7 @@ Item {
317317 rawActions: ["reply_id", "Dummy"]
318318 },
319319 Notification {
320− nid: index++
320+ nid: 5
321321 type: Notification.SnapDecision
322322 hints: {"x-canonical-private-affirmative-tint": "false",
323323 "sound-file": "dummy.ogg"}
@@ -330,7 +330,7 @@ Item {
330330 "reject_id", "Reject"]
331331 },
332332 Notification {
333− nid: index++
333+ nid: 6
334334 type: Notification.Ephemeral
335335 hints: {"x-canonical-private-affirmative-tint": "false",
336336 "sound-file": "dummy.ogg"}
@@ -342,7 +342,7 @@ Item {
342342 rawActions: []
343343 },
344344 Notification {
345− nid: index++
345+ nid: 7
346346 type: Notification.Ephemeral
347347 hints: {"x-canonical-private-affirmative-tint": "false",
348348 "x-canonical-non-shaped-icon": "true"}
@@ -354,7 +354,7 @@ Item {
354354 rawActions: []
355355 },
356356 Notification {
357− nid: index++
357+ nid: 8
358358 type: Notification.Confirmation
359359 hints: {"x-canonical-non-shaped-icon": "true"}
360360 summary: ""
@@ -365,7 +365,7 @@ Item {
365365 rawActions: []
366366 },
367367 Notification {
368− nid: index++
368+ nid: 9
369369 type: Notification.Confirmation
370370 hints: {"x-canonical-non-shaped-icon": "true",
371371 "x-canonical-value-bar-tint" : "true"}
@@ -375,7 +375,7 @@ Item {
375375 secondaryIcon: ""
376376 value: 85
377377 rawActions: []
378− }*/
378+ }
379379 ]
380380
381381 function test_NotificationRenderer_data() {
@@ -395,7 +395,7 @@ Item {
395395 valueVisible: false,
396396 valueLabelVisible: false,
397397 valueTinted: false
398− }/*,
398+ },
399399 {
400400 tag: "Ephemeral notification - icon-summary layout",
401401 n: nlist[1],
@@ -524,7 +524,7 @@ Item {
524524 valueVisible: true,
525525 valueLabelVisible: true,
526526 valueTinted: true
527− }*/
527+ }
528528 ]
529529 }
530530
@@ -548,6 +548,9 @@ Item {
548548 }
549549
550550 function test_NotificationRenderer(data) {
551+ // hook up notification's completed-signal with model's onCompleted-slot, so that remove happens on close()
552+ data.n.completed.connect(mockModel.onCompleted)
553+
551554 // populate model with some mock notifications
552555 mockModel.append(data.n)
553556
@@ -589,7 +592,7 @@ Item {
589592 mouseClick(notification)
590593 if(data.n.type === Notification.Interactive) {
591594 actionSpy.wait()
592− compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
595+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[0], "got wrong id for interactive action")
593596 }
594597 compare(clickThroughSpy.count, 0, "click on notification fell through")
595598
@@ -599,16 +602,16 @@ Item {
599602 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
600603
601604 var audioItem = findInvisibleChild(notification, "sound")
602− compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
605+ //compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
603606
604607 if(data.buttonRowVisible) {
605608 var buttonCancel = findChild(buttonRow, "notify_button1")
606609 var buttonAccept = findChild(buttonRow, "notify_button0")
607610
608611 // only test the left/cancel-button if two actions have been passed in
609− if (data.actions.length == 2) {
612+ if (data.n.rawActions.length === 4) {
610613 tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
611− compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
614+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[2], "got wrong id for negative action")
612615 actionSpy.clear()
613616 }
614617
@@ -617,7 +620,7 @@ Item {
617620
618621 // click the positive/right button
619622 tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
620− compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
623+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[0], "got wrong id positive action")
621624 actionSpy.clear()
622625 waitForRendering (notification)
623626
@@ -632,19 +635,19 @@ Item {
632635 // try clicking on choices in expanded comboList
633636 var choiceButton1 = findChild(notification, "notify_button3")
634637 tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
635− compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
638+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[6], "got wrong id choice action 1")
636639 actionSpy.clear()
637640
638641 var choiceButton2 = findChild(notification, "notify_button4")
639642 tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
640− compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
643+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[8], "got wrong id choice action 2")
641644 actionSpy.clear()
642645
643646 // click to collapse
644647 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
645648 } else {
646649 mouseClick(buttonCancel)
647− compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
650+ compare(actionSpy.signalArguments[0][0], data.n.rawActions[2], "got wrong id for negative action")
648651 }
649652 }
650653
@@ -655,10 +658,10 @@ Item {
655658 var dragY = notification.height / 2;
656659 touchFlick(notification, dragStart, dragY, dragEnd, dragY)
657660 waitForRendering(notification)
658− if (data.type !== Notification.SnapDecision && notification.state !== "expanded") {
659− tryCompare(mockModel, "count", before - 1)
660− } else {
661+ if (data.n.type !== Notification.SnapDecision && notification.state !== "expanded") {
661662 tryCompare(mockModel, "count", before)
663+ } else {
664+ tryCompare(mockModel, "count", before - 1)
662665 }
663666 }
664667 }