on xenial help sign in
Trying to sort out the binding-loop for property (n)id of the MockNotification.
898bf67Mirco Müller
tests/mocks/Unity/Notifications/MockNotification.cpp+3
@@ -19,6 +19,8 @@
19
19
20#include "MockNotification.h"
20#include "MockNotification.h"
21
21
22+#include <QDebug>
23+
22struct MockNotificationPrivate {
24struct MockNotificationPrivate {
23 int id;
25 int id;
24 QString summary;
26 QString summary;
@@ -64,6 +66,7 @@ void MockNotification::setBody(const QString &body) {
64}
66}
65
67
66int MockNotification::getID() const {
68int MockNotification::getID() const {
69+ qDebug() << "nid:" << p->id;
67 return p->id;
70 return p->id;
68}
71}
69
72
tests/qmltests/Notifications/tst_Notifications.qml+5−6
@@ -284,7 +284,6 @@ Item {
284 Notification {
284 Notification {
285 nid: index++
285 nid: index++
286 type: Notification.Ephemeral
286 type: Notification.Ephemeral
287− hints: {}
288 summary: "Photo upload completed"
287 summary: "Photo upload completed"
289 body: ""
288 body: ""
290 icon: "../graphics/applicationIcons/facebook.png"
289 icon: "../graphics/applicationIcons/facebook.png"
@@ -396,7 +395,7 @@ Item {
396 valueVisible: false,
395 valueVisible: false,
397 valueLabelVisible: false,
396 valueLabelVisible: false,
398 valueTinted: false
397 valueTinted: false
399− },
398+ }/*,
400 {
399 {
401 tag: "Ephemeral notification - icon-summary layout",
400 tag: "Ephemeral notification - icon-summary layout",
402 n: nlist[1],
401 n: nlist[1],
@@ -525,7 +524,7 @@ Item {
525 valueVisible: true,
524 valueVisible: true,
526 valueLabelVisible: true,
525 valueLabelVisible: true,
527 valueTinted: true
526 valueTinted: true
528− }
527+ }*/
529 ]
528 ]
530 }
529 }
531
530
@@ -588,7 +587,7 @@ Item {
588
587
589 // test input does not fall through
588 // test input does not fall through
590 mouseClick(notification)
589 mouseClick(notification)
591− if(data.type == Notification.Interactive) {
590+ if(data.n.type === Notification.Interactive) {
592 actionSpy.wait()
591 actionSpy.wait()
593 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
592 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
594 }
593 }
@@ -623,9 +622,9 @@ Item {
623 waitForRendering (notification)
622 waitForRendering (notification)
624
623
625 // check if there's a ComboButton created due to more actions being passed
624 // check if there's a ComboButton created due to more actions being passed
626− if (data.actions.length > 2) {
625+ if (data.n.actions.length > 2) {
627 var comboButton = findChild(notification, "notify_button2")
626 var comboButton = findChild(notification, "notify_button2")
628− tryCompareFunction(function() { return comboButton.expanded == false; }, true);
627+ tryCompareFunction(function() { return comboButton.expanded === false; }, true);
629
628
630 // click to expand
629 // click to expand
631 tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == true; }, true);
630 tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == true; }, true);