@@ -269,7 +269,7 @@ Item {
270 property list<Notification> nlist: [
270 property list<Notification> nlist: [
271 Notification {
271 Notification {
272− nid: index++
272+ nid: 1
273 type: Notification.SnapDecision
273 type: Notification.SnapDecision
274 hints: {"x-canonical-private-affirmative-tint": "true"}
274 hints: {"x-canonical-private-affirmative-tint": "true"}
275 summary: "Theatre at Ferria Stadium"
275 summary: "Theatre at Ferria Stadium"
@@ -280,9 +280,9 @@ Item {
280 rawActions: ["ok_id", "Ok",
280 rawActions: ["ok_id", "Ok",
281 "snooze_id", "Snooze",
281 "snooze_id", "Snooze",
282 "view_id", "View"]
282 "view_id", "View"]
284 Notification {
284 Notification {
285− nid: index++
285+ nid: 2
286 type: Notification.Ephemeral
286 type: Notification.Ephemeral
287 summary: "Photo upload completed"
287 summary: "Photo upload completed"
@@ -292,7 +292,7 @@ Item {
292 rawActions: []
292 rawActions: []
294 Notification {
294 Notification {
295− nid: index++
295+ nid: 3
296 type: Notification.Ephemeral
296 type: Notification.Ephemeral
297 hints: {"x-canonical-private-affirmative-tint": "false",
297 hints: {"x-canonical-private-affirmative-tint": "false",
298 "sound-file": "dummy.ogg",
298 "sound-file": "dummy.ogg",
@@ -305,7 +305,7 @@ Item {
305 rawActions: []
305 rawActions: []
307 Notification {
307 Notification {
308− nid: index++
308+ nid: 4
309 type: Notification.Interactive
309 type: Notification.Interactive
310 hints: {"x-canonical-private-affirmative-tint": "false",
310 hints: {"x-canonical-private-affirmative-tint": "false",
311 "sound-file": "dummy.ogg"}
311 "sound-file": "dummy.ogg"}
@@ -317,7 +317,7 @@ Item {
317 rawActions: ["reply_id", "Dummy"]
317 rawActions: ["reply_id", "Dummy"]
319 Notification {
319 Notification {
320− nid: index++
320+ nid: 5
321 type: Notification.SnapDecision
321 type: Notification.SnapDecision
322 hints: {"x-canonical-private-affirmative-tint": "false",
322 hints: {"x-canonical-private-affirmative-tint": "false",
323 "sound-file": "dummy.ogg"}
323 "sound-file": "dummy.ogg"}
@@ -330,7 +330,7 @@ Item {
330 "reject_id", "Reject"]
330 "reject_id", "Reject"]
332 Notification {
332 Notification {
333− nid: index++
333+ nid: 6
334 type: Notification.Ephemeral
334 type: Notification.Ephemeral
335 hints: {"x-canonical-private-affirmative-tint": "false",
335 hints: {"x-canonical-private-affirmative-tint": "false",
336 "sound-file": "dummy.ogg"}
336 "sound-file": "dummy.ogg"}
@@ -342,7 +342,7 @@ Item {
342 rawActions: []
342 rawActions: []
344 Notification {
344 Notification {
345− nid: index++
345+ nid: 7
346 type: Notification.Ephemeral
346 type: Notification.Ephemeral
347 hints: {"x-canonical-private-affirmative-tint": "false",
347 hints: {"x-canonical-private-affirmative-tint": "false",
348 "x-canonical-non-shaped-icon": "true"}
348 "x-canonical-non-shaped-icon": "true"}
@@ -354,7 +354,7 @@ Item {
354 rawActions: []
354 rawActions: []
356 Notification {
356 Notification {
357− nid: index++
357+ nid: 8
358 type: Notification.Confirmation
358 type: Notification.Confirmation
359 hints: {"x-canonical-non-shaped-icon": "true"}
359 hints: {"x-canonical-non-shaped-icon": "true"}
360 summary: ""
360 summary: ""
@@ -365,7 +365,7 @@ Item {
365 rawActions: []
365 rawActions: []
367 Notification {
367 Notification {
368− nid: index++
368+ nid: 9
369 type: Notification.Confirmation
369 type: Notification.Confirmation
370 hints: {"x-canonical-non-shaped-icon": "true",
370 hints: {"x-canonical-non-shaped-icon": "true",
371 "x-canonical-value-bar-tint" : "true"}
371 "x-canonical-value-bar-tint" : "true"}
@@ -375,7 +375,7 @@ Item {
375 secondaryIcon: ""
375 secondaryIcon: ""
376 value: 85
376 value: 85
377 rawActions: []
377 rawActions: []
381 function test_NotificationRenderer_data() {
381 function test_NotificationRenderer_data() {
@@ -395,7 +395,7 @@ Item {
395 valueVisible: false,
395 valueVisible: false,
396 valueLabelVisible: false,
396 valueLabelVisible: false,
397 valueTinted: false
397 valueTinted: false
400 tag: "Ephemeral notification - icon-summary layout",
400 tag: "Ephemeral notification - icon-summary layout",
401 n: nlist[1],
401 n: nlist[1],
@@ -524,7 +524,7 @@ Item {
524 valueVisible: true,
524 valueVisible: true,
525 valueLabelVisible: true,
525 valueLabelVisible: true,
526 valueTinted: true
526 valueTinted: true
@@ -548,6 +548,9 @@ Item {
550 function test_NotificationRenderer(data) {
550 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)
551 // populate model with some mock notifications
554 // populate model with some mock notifications
552 mockModel.append(data.n)
555 mockModel.append(data.n)
@@ -589,7 +592,7 @@ Item {
589 mouseClick(notification)
592 mouseClick(notification)
590 if(data.n.type === Notification.Interactive) {
593 if(data.n.type === Notification.Interactive) {
591 actionSpy.wait()
594 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")
594 compare(clickThroughSpy.count, 0, "click on notification fell through")
597 compare(clickThroughSpy.count, 0, "click on notification fell through")
@@ -599,16 +602,16 @@ Item {
599 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
602 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
601 var audioItem = findInvisibleChild(notification, "sound")
604 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")
604 if(data.buttonRowVisible) {
607 if(data.buttonRowVisible) {
605 var buttonCancel = findChild(buttonRow, "notify_button1")
608 var buttonCancel = findChild(buttonRow, "notify_button1")
606 var buttonAccept = findChild(buttonRow, "notify_button0")
609 var buttonAccept = findChild(buttonRow, "notify_button0")
608 // only test the left/cancel-button if two actions have been passed in
611 // 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) {
610 tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
613 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")
612 actionSpy.clear()
615 actionSpy.clear()
@@ -617,7 +620,7 @@ Item {
618 // click the positive/right button
621 // click the positive/right button
619 tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
622 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")
621 actionSpy.clear()
624 actionSpy.clear()
622 waitForRendering (notification)
625 waitForRendering (notification)
@@ -632,19 +635,19 @@ Item {
632 // try clicking on choices in expanded comboList
635 // try clicking on choices in expanded comboList
633 var choiceButton1 = findChild(notification, "notify_button3")
636 var choiceButton1 = findChild(notification, "notify_button3")
634 tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
637 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")
636 actionSpy.clear()
639 actionSpy.clear()
638 var choiceButton2 = findChild(notification, "notify_button4")
641 var choiceButton2 = findChild(notification, "notify_button4")
639 tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
642 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")
641 actionSpy.clear()
644 actionSpy.clear()
643 // click to collapse
646 // click to collapse
644 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
647 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
646 mouseClick(buttonCancel)
649 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")
@@ -655,10 +658,10 @@ Item {
655 var dragY = notification.height / 2;
658 var dragY = notification.height / 2;
656 touchFlick(notification, dragStart, dragY, dragEnd, dragY)
659 touchFlick(notification, dragStart, dragY, dragEnd, dragY)
657 waitForRendering(notification)
660 waitForRendering(notification)
658− if (data.type !== Notification.SnapDecision && notification.state !== "expanded") {
661+ if (data.n.type !== Notification.SnapDecision && notification.state !== "expanded") {
659− tryCompare(mockModel, "count", before - 1)
661 tryCompare(mockModel, "count", before)
662 tryCompare(mockModel, "count", before)
664+ tryCompare(mockModel, "count", before - 1)