on xenial help sign in
Slightly better...
f8c18e6Mirco Müller
tests/mocks/Unity/Notifications/MockNotification.cpp+1−1
@@ -173,6 +173,6 @@ void MockNotification::invokeAction(const QString &action) {
173}
173}
174
174
175void MockNotification::close() {
175void MockNotification::close() {
176− qDebug() << "close() called";
176+ qDebug() << "close() called, " << p->id;
177 Q_EMIT completed(p->id);
177 Q_EMIT completed(p->id);
178}
178}
tests/mocks/Unity/Notifications/MockNotificationModel.cpp+2
@@ -119,6 +119,7 @@ bool MockNotificationModel::hasNotification(unsigned int id) const {
119}
119}
120
120
121void MockNotificationModel::remove(const unsigned int id) {
121void MockNotificationModel::remove(const unsigned int id) {
122+ qDebug() << "remove(" << id << ")";
122 for(int i = 0; i < m_queue.size(); i++) {
123 for(int i = 0; i < m_queue.size(); i++) {
123 if(m_queue[i]->getID() == id) {
124 if(m_queue[i]->getID() == id) {
124 deleteFromVisible(i);
125 deleteFromVisible(i);
@@ -135,6 +136,7 @@ void MockNotificationModel::deleteFirst() {
135}
136}
136
137
137void MockNotificationModel::deleteFromVisible(int loc) {
138void MockNotificationModel::deleteFromVisible(int loc) {
139+ qDebug() << "deleteFromVisible(" << loc << ")";
138 QModelIndex deletePoint = QModelIndex();
140 QModelIndex deletePoint = QModelIndex();
139 beginRemoveRows(deletePoint, loc, loc);
141 beginRemoveRows(deletePoint, loc, loc);
140 m_queue.erase(m_queue.begin() + loc);
142 m_queue.erase(m_queue.begin() + loc);
tests/qmltests/Notifications/tst_Notifications.qml+7−7
@@ -43,7 +43,7 @@ Item {
43 secondaryIcon: ""
43 secondaryIcon: ""
44 rawActions: ["reply_id", "Dummy"]
44 rawActions: ["reply_id", "Dummy"]
45 Component.onCompleted: {
45 Component.onCompleted: {
46− n0.completed.connect(mockModel.remove)
46+ n0.completed.connect(mockModel.onCompleted)
47 }
47 }
48 },
48 },
49 Notification {
49 Notification {
@@ -59,7 +59,7 @@ Item {
59 "snooze_id", "Snooze",
59 "snooze_id", "Snooze",
60 "view_id", "View"]
60 "view_id", "View"]
61 Component.onCompleted: {
61 Component.onCompleted: {
62− n1.completed.connect(mockModel.remove)
62+ n1.completed.connect(mockModel.onCompleted)
63 }
63 }
64 },
64 },
65 Notification {
65 Notification {
@@ -72,7 +72,7 @@ Item {
72 secondaryIcon: "../graphics/applicationIcons/facebook.png"
72 secondaryIcon: "../graphics/applicationIcons/facebook.png"
73 rawActions: ["reply_id", "Dummy"]
73 rawActions: ["reply_id", "Dummy"]
74 Component.onCompleted: {
74 Component.onCompleted: {
75− n2.completed.connect(mockModel.remove)
75+ n2.completed.connect(mockModel.onCompleted)
76 }
76 }
77 },
77 },
78 Notification {
78 Notification {
@@ -86,7 +86,7 @@ Item {
86 secondaryIcon: ""
86 secondaryIcon: ""
87 rawActions: ["reply_id", "Dummy"]
87 rawActions: ["reply_id", "Dummy"]
88 Component.onCompleted: {
88 Component.onCompleted: {
89− n3.completed.connect(mockModel.remove)
89+ n3.completed.connect(mockModel.onCompleted)
90 }
90 }
91 },
91 },
92 Notification {
92 Notification {
@@ -100,7 +100,7 @@ Item {
100 secondaryIcon: ""
100 secondaryIcon: ""
101 rawActions: ["reply_id", "Dummy"]
101 rawActions: ["reply_id", "Dummy"]
102 Component.onCompleted: {
102 Component.onCompleted: {
103− n4.completed.connect(mockModel.remove)
103+ n4.completed.connect(mockModel.onCompleted)
104 }
104 }
105 },
105 },
106 Notification {
106 Notification {
@@ -128,7 +128,7 @@ Item {
128 value: 50
128 value: 50
129 rawActions: ["reply_id", "Dummy"]
129 rawActions: ["reply_id", "Dummy"]
130 Component.onCompleted: {
130 Component.onCompleted: {
131− n6.completed.connect(mockModel.remove)
131+ n6.completed.connect(mockModel.onCompleted)
132 }
132 }
133 },
133 },
134 Notification {
134 Notification {
@@ -144,7 +144,7 @@ Item {
144 value: 85
144 value: 85
145 rawActions: ["reply_id", "Dummy"]
145 rawActions: ["reply_id", "Dummy"]
146 Component.onCompleted: {
146 Component.onCompleted: {
147− n7.completed.connect(mockModel.remove)
147+ n7.completed.connect(mockModel.onCompleted)
148 }
148 }
149 }
149 }
150 ]
150 ]