on xenial help sign in
Trying to sort out the binding-loop for property (n)id of the MockNotification.
commit898bf6706e9955b3297b8efbb487eb3a1356ed35 authorMirco Müller <mirco.mueller@ubuntu.com> dateWed 21 Jan 2015, 15:39 (12 years ago) parent91112e6
2 files changed+8−6
tests/mocks/Unity/Notifications/MockNotification.cpp+3 tests/qmltests/Notifications/tst_Notifications.qml+5−6
tests/mocks/Unity/Notifications/MockNotification.cpp+3
@@ -19,6 +19,8 @@
1919
2020#include "MockNotification.h"
2121
22+#include <QDebug>
23+
2224struct MockNotificationPrivate {
2325 int id;
2426 QString summary;
@@ -64,6 +66,7 @@ void MockNotification::setBody(const QString &body) {
6466}
6567
6668int MockNotification::getID() const {
69+ qDebug() << "nid:" << p->id;
6770 return p->id;
6871}
6972
tests/qmltests/Notifications/tst_Notifications.qml+5−6
@@ -284,7 +284,6 @@ Item {
284284 Notification {
285285 nid: index++
286286 type: Notification.Ephemeral
287− hints: {}
288287 summary: "Photo upload completed"
289288 body: ""
290289 icon: "../graphics/applicationIcons/facebook.png"
@@ -396,7 +395,7 @@ Item {
396395 valueVisible: false,
397396 valueLabelVisible: false,
398397 valueTinted: false
399− },
398+ }/*,
400399 {
401400 tag: "Ephemeral notification - icon-summary layout",
402401 n: nlist[1],
@@ -525,7 +524,7 @@ Item {
525524 valueVisible: true,
526525 valueLabelVisible: true,
527526 valueTinted: true
528− }
527+ }*/
529528 ]
530529 }
531530
@@ -588,7 +587,7 @@ Item {
588587
589588 // test input does not fall through
590589 mouseClick(notification)
591− if(data.type == Notification.Interactive) {
590+ if(data.n.type === Notification.Interactive) {
592591 actionSpy.wait()
593592 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
594593 }
@@ -623,9 +622,9 @@ Item {
623622 waitForRendering (notification)
624623
625624 // 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) {
627626 var comboButton = findChild(notification, "notify_button2")
628− tryCompareFunction(function() { return comboButton.expanded == false; }, true);
627+ tryCompareFunction(function() { return comboButton.expanded === false; }, true);
629628
630629 // click to expand
631630 tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == true; }, true);