23
23
import Unity.Notifications 1.0
24
24
import QtMultimedia 5.0
33
function invokeAction(actionId) {
34
mockModel.actionInvoked(actionId)
42
signal actionInvoked(string actionId)
45
return mockNotification.createObject(mockModel)
48
// add the default/PlaceHolder notification to the model
49
Component.onCompleted: {
27
width: notificationsRect.width + interactiveControls.width
28
height: notificationsRect.height
37
function invokeAction(actionId) {
38
mockModel.actionInvoked(actionId)
47
signal actionInvoked(string actionId)
50
return mockNotification.createObject(mockModel)
53
// add the default/PlaceHolder notification to the model
54
Component.onCompleted: {
56
type: Notification.PlaceHolder,
69
function add2over1SnapDecisionNotification() {
51
type: Notification.PlaceHolder,
64
function addSnapDecisionNotification() {
66
type: Notification.SnapDecision,
67
hints: {"x-canonical-private-affirmative-tint": "true"},
69
body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
70
icon: "../graphics/avatars/funky.png",
71
secondaryIcon: "../graphics/applicationIcons/facebook.png",
72
actions: [{ id: "ok_id", label: "Ok"},
73
{ id: "cancel_id", label: "Cancel"},
74
{ id: "notreally_id", label: "Not really"},
75
{ id: "noway_id", label: "messages:No way"},
76
{ id: "nada_id", label: "messages:Nada"}]
82
function add2over1SnapDecisionNotification() {
84
type: Notification.SnapDecision,
85
hints: {"x-canonical-private-affirmative-tint": "true",},
86
summary: "Theatre at Ferria Stadium",
87
body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
90
actions: [{ id: "ok_id", label: "Ok"},
91
{ id: "snooze_id", label: "Snooze"},
92
{ id: "view_id", label: "View"}]
98
function addEphemeralNotification() {
100
type: Notification.Ephemeral,
101
summary: "Cole Raby",
102
body: "I did not expect it to be that late.",
103
icon: "../graphics/avatars/amanda.png",
104
secondaryIcon: "../graphics/applicationIcons/facebook.png",
111
function addEphemeralNonShapedIconNotification() {
113
type: Notification.Ephemeral,
114
hints: {"x-canonical-non-shaped-icon": "true"},
116
body: "Synchronised contacts-database with cloud-storage.",
117
icon: "../graphics/applicationIcons/contacts-app.png",
125
function addEphemeralIconSummaryNotification() {
127
type: Notification.Ephemeral,
128
summary: "Photo upload completed",
131
secondaryIcon: "../graphics/applicationIcons/facebook.png",
138
function addInteractiveNotification() {
140
type: Notification.Interactive,
141
summary: "Interactive notification",
142
body: "This is a notification that can be clicked",
143
icon: "../graphics/avatars/anna_olsson.png",
145
actions: [{ id: "reply_id", label: "Dummy"}],
151
function clearNotifications() {
155
function remove1stNotification() {
156
if (mockModel.count > 0)
161
id: notificationsRect
167
id: clickThroughCatcher
183
id: interactiveControls
192
anchors.margins: units.gu(1)
196
text: "add a snap-decision"
197
onClicked: addSnapDecisionNotification()
202
text: "add a 2over1 snap-decision"
203
onClicked: add2over1SnapDecisionNotification()
208
text: "add an ephemeral"
209
onClicked: addEphemeralNotification()
214
text: "add an non-shaped-icon-summary-body"
215
onClicked: addEphemeralNonShapedIconNotification()
220
text: "add an icon-summary"
221
onClicked: addEphemeralIconSummaryNotification()
226
text: "add an interactive"
227
onClicked: addInteractiveNotification()
232
text: "remove 1st notification"
233
onClicked: remove1stNotification()
239
onClicked: clearNotifications()
246
name: "NotificationRendererTest"
249
function test_NotificationRenderer_data() {
252
tag: "Snap Decision with secondary icon and button-tint",
253
type: Notification.SnapDecision,
254
hints: {"x-canonical-private-affirmative-tint": "true"},
256
body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
257
icon: "../graphics/avatars/funky.png",
258
secondaryIcon: "../graphics/applicationIcons/facebook.png",
259
actions: [{ id: "ok_id", label: "Ok"},
260
{ id: "cancel_id", label: "Cancel"},
261
{ id: "notreally_id", label: "Not really"},
262
{ id: "noway_id", label: "messages:No way"},
263
{ id: "nada_id", label: "messages:Nada"}],
264
summaryVisible: true,
268
nonShapedIcon: false,
269
secondaryIconVisible: true,
270
buttonRowVisible: true,
275
tag: "2-over-1 Snap Decision with button-tint",
276
71
type: Notification.SnapDecision,
277
72
hints: {"x-canonical-private-affirmative-tint": "true"},
278
73
summary: "Theatre at Ferria Stadium",
281
76
secondaryIcon: "",
282
77
actions: [{ id: "ok_id", label: "Ok"},
283
78
{ id: "snooze_id", label: "Snooze"},
284
{ id: "view_id", label: "View"}],
285
summaryVisible: true,
289
nonShapedIcon: false,
290
secondaryIconVisible: false,
291
buttonRowVisible: false,
296
tag: "Ephemeral notification - icon-summary layout",
297
type: Notification.Ephemeral,
298
hints: {"x-canonical-private-affirmative-tint": "false"},
79
{ id: "view_id", label: "View"}]
85
function addEphemeralNotification() {
87
type: Notification.Ephemeral,
89
body: "I did not expect it to be that late.",
90
icon: "../graphics/avatars/amanda.png",
91
secondaryIcon: "../graphics/applicationIcons/facebook.png",
98
function addEphemeralNonShapedIconNotification() {
100
type: Notification.Ephemeral,
101
hints: {"x-canonical-non-shaped-icon": "true"},
103
body: "Synchronised contacts-database with cloud-storage.",
104
icon: "../graphics/applicationIcons/contacts-app.png",
112
function addEphemeralIconSummaryNotification() {
114
type: Notification.Ephemeral,
115
hints: {"x-canonical-non-shaped-icon": "false"},
299
116
summary: "Photo upload completed",
302
secondaryIcon: "../graphics/applicationIcons/facebook.png",
304
summaryVisible: true,
308
nonShapedIcon: false,
309
secondaryIconVisible: true,
310
buttonRowVisible: false,
315
tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
316
type: Notification.Ephemeral,
317
hints: {"x-canonical-private-affirmative-tint": "false",
318
"sound-file": "dummy.ogg",
319
"suppress-sound": "true"},
320
summary: "New comment successfully published",
323
secondaryIcon: "../graphics/applicationIcons/facebook.png",
325
summaryVisible: true,
327
interactiveAreaEnabled: false,
330
nonShapedIcon: false,
331
secondaryIconVisible: true,
332
buttonRowVisible: false,
337
tag: "Interactive notification",
118
icon: "../graphics/applicationIcons/facebook.png",
126
function addInteractiveNotification() {
338
128
type: Notification.Interactive,
339
hints: {"x-canonical-private-affirmative-tint": "false",
340
"sound-file": "dummy.ogg"},
341
129
summary: "Interactive notification",
342
130
body: "This is a notification that can be clicked",
343
icon: "../graphics/avatars/amanda.png",
131
icon: "../graphics/avatars/anna_olsson.png",
344
132
secondaryIcon: "",
345
133
actions: [{ id: "reply_id", label: "Dummy"}],
346
summaryVisible: true,
350
nonShapedIcon: false,
351
secondaryIconVisible: false,
352
buttonRowVisible: false,
357
tag: "Snap Decision without secondary icon and no button-tint",
358
type: Notification.SnapDecision,
359
hints: {"x-canonical-private-affirmative-tint": "false",
360
"sound-file": "dummy.ogg"},
362
body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
363
icon: "../graphics/avatars/anna_olsson.png",
365
actions: [{ id: "accept_id", label: "Accept"},
366
{ id: "reject_id", label: "Reject"}],
367
summaryVisible: true,
371
nonShapedIcon: false,
372
secondaryIconVisible: false,
373
buttonRowVisible: true,
378
tag: "Ephemeral notification",
379
type: Notification.Ephemeral,
380
hints: {"x-canonical-private-affirmative-tint": "false",
381
"sound-file": "dummy.ogg"},
382
summary: "Cole Raby",
383
body: "I did not expect it to be that late.",
384
icon: "../graphics/avatars/funky.png",
385
secondaryIcon: "../graphics/applicationIcons/facebook.png",
387
summaryVisible: true,
391
nonShapedIcon: false,
392
secondaryIconVisible: true,
393
buttonRowVisible: false,
398
tag: "Ephemeral notification with non-shaped icon",
399
type: Notification.Ephemeral,
400
hints: {"x-canonical-private-affirmative-tint": "false",
401
"x-canonical-non-shaped-icon": "true"},
403
body: "Synchronised contacts-database with cloud-storage.",
404
icon: "../graphics/applicationIcons/contacts-app.png",
407
summaryVisible: true,
412
secondaryIconVisible: false,
413
buttonRowVisible: false,
423
target: clickThroughCatcher
424
signalName: "clicked"
431
signalName: "actionInvoked"
435
clickThroughSpy.clear()
439
function test_NotificationRenderer(data) {
440
// populate model with some mock notifications
441
mockModel.append(data)
443
// make sure the view is properly updated before going on
444
notifications.forceLayout();
445
waitForRendering(notifications);
447
var notification = findChild(notifications, "notification" + (mockModel.count - 1))
448
verify(notification !== undefined, "notification wasn't found");
450
waitForRendering(notification);
452
var icon = findChild(notification, "icon")
453
var shapedIcon = findChild(notification, "shapedIcon")
454
var nonShapedIcon = findChild(notification, "nonShapedIcon")
455
var interactiveArea = findChild(notification, "interactiveArea")
456
var secondaryIcon = findChild(notification, "secondaryIcon")
457
var summaryLabel = findChild(notification, "summaryLabel")
458
var bodyLabel = findChild(notification, "bodyLabel")
459
var buttonRow = findChild(notification, "buttonRow")
461
compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
462
compare(shapedIcon.visible, data.shapedIcon, "shaped-icon visibility is incorrect")
463
compare(nonShapedIcon.visible, data.nonShapedIcon, "non-shaped-icon visibility is incorrect")
465
// test input does not fall through
466
mouseClick(notification, notification.width / 2, notification.height / 2)
467
if(data.type == Notification.Interactive) {
469
compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
471
compare(clickThroughSpy.count, 0, "click on notification fell through")
473
compare(secondaryIcon.visible, data.secondaryIconVisible, "secondary-icon visibility is incorrect")
474
compare(summaryLabel.visible, data.summaryVisible, "summary-text visibility is incorrect")
475
compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
476
compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
478
var audioItem = findInvisibleChild(notification, "sound")
479
compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
481
if(data.buttonRowVisible) {
482
var buttonCancel = findChild(buttonRow, "notify_button1")
483
var buttonAccept = findChild(buttonRow, "notify_button0")
485
// only test the left/cancel-button if two actions have been passed in
486
if (data.actions.length == 2) {
487
tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
488
compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
492
// check the tinting of the positive/right button
493
verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
495
// click the positive/right button
496
tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
497
compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
139
function addConfirmationNotification() {
141
type: Notification.Confirmation,
142
hints: {"x-canonical-non-shaped-icon": "true"},
143
summary: "Confirmation notification",
145
icon: "image://theme/audio-volume-medium",
154
function add2ndConfirmationNotification() {
156
type: Notification.Confirmation,
157
hints: {"x-canonical-non-shaped-icon": "true",
158
"x-canonical-value-bar-tint": "true"},
159
summary: "Confirmation notification",
161
icon: "image://theme/audio-volume-high",
170
function clearNotifications() {
171
while(mockModel.count > 1) {
172
remove1stNotification()
176
function remove1stNotification() {
177
if (mockModel.count > 1)
182
id: notificationsRect
185
height: units.gu(115)
188
id: clickThroughCatcher
204
id: interactiveControls
207
height: units.gu(115)
213
anchors.margins: units.gu(1)
217
text: "add a 2over1 snap-decision"
218
onClicked: rootRow.add2over1SnapDecisionNotification()
223
text: "add an ephemeral"
224
onClicked: rootRow.addEphemeralNotification()
229
text: "add an non-shaped-icon-summary-body"
230
onClicked: rootRow.addEphemeralNonShapedIconNotification()
235
text: "add an icon-summary"
236
onClicked: rootRow.addEphemeralIconSummaryNotification()
241
text: "add an interactive"
242
onClicked: rootRow.addInteractiveNotification()
247
text: "add a confirmation"
248
onClicked: rootRow.addConfirmationNotification()
253
text: "add a 2nd confirmation"
254
onClicked: rootRow.add2ndConfirmationNotification()
259
text: "remove 1st notification"
260
onClicked: rootRow.remove1stNotification()
266
onClicked: rootRow.clearNotifications()
273
name: "NotificationRendererTest"
276
function test_NotificationRenderer_data() {
279
tag: "2-over-1 Snap Decision with button-tint",
280
type: Notification.SnapDecision,
281
hints: {"x-canonical-private-affirmative-tint": "true"},
282
summary: "Theatre at Ferria Stadium",
283
body: "at Ferria Stadium in Bilbao, Spain\n07578545317",
286
actions: [{ id: "ok_id", label: "Ok"},
287
{ id: "snooze_id", label: "Snooze"},
288
{ id: "view_id", label: "View"}],
289
summaryVisible: true,
292
centeredIconVisible: false,
294
secondaryIconVisible: false,
295
buttonRowVisible: false,
299
valueLabelVisible: false,
303
tag: "Ephemeral notification - icon-summary layout",
304
type: Notification.Ephemeral,
306
summary: "Photo upload completed",
308
icon: "../graphics/applicationIcons/facebook.png",
311
summaryVisible: true,
314
centeredIconVisible: false,
316
secondaryIconVisible: false,
317
buttonRowVisible: false,
321
valueLabelVisible: false,
325
tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
326
type: Notification.Ephemeral,
327
hints: {"x-canonical-private-affirmative-tint": "false",
328
"sound-file": "dummy.ogg",
329
"suppress-sound": "true"},
330
summary: "New comment successfully published",
333
secondaryIcon: "../graphics/applicationIcons/facebook.png",
335
summaryVisible: true,
337
interactiveAreaEnabled: false,
339
centeredIconVisible: false,
341
secondaryIconVisible: true,
342
buttonRowVisible: false,
346
valueLabelVisible: false,
350
tag: "Interactive notification",
351
type: Notification.Interactive,
352
hints: {"x-canonical-private-affirmative-tint": "false",
353
"sound-file": "dummy.ogg"},
354
summary: "Interactive notification",
355
body: "This is a notification that can be clicked",
356
icon: "../graphics/avatars/amanda.png",
358
actions: [{ id: "reply_id", label: "Dummy"}],
359
summaryVisible: true,
362
centeredIconVisible: false,
364
secondaryIconVisible: false,
365
buttonRowVisible: false,
369
valueLabelVisible: false,
373
tag: "Snap Decision without secondary icon and no button-tint",
374
type: Notification.SnapDecision,
375
hints: {"x-canonical-private-affirmative-tint": "false",
376
"sound-file": "dummy.ogg"},
378
body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
379
icon: "../graphics/avatars/anna_olsson.png",
381
actions: [{ id: "accept_id", label: "Accept"},
382
{ id: "reject_id", label: "Reject"}],
383
summaryVisible: true,
386
centeredIconVisible: false,
388
secondaryIconVisible: false,
389
buttonRowVisible: true,
393
valueLabelVisible: false,
397
tag: "Ephemeral notification",
398
type: Notification.Ephemeral,
399
hints: {"x-canonical-private-affirmative-tint": "false",
400
"sound-file": "dummy.ogg"},
401
summary: "Cole Raby",
402
body: "I did not expect it to be that late.",
403
icon: "../graphics/avatars/funky.png",
404
secondaryIcon: "../graphics/applicationIcons/facebook.png",
406
summaryVisible: true,
409
centeredIconVisible: false,
411
secondaryIconVisible: true,
412
buttonRowVisible: false,
416
valueLabelVisible: false,
420
tag: "Ephemeral notification with non-shaped icon",
421
type: Notification.Ephemeral,
422
hints: {"x-canonical-private-affirmative-tint": "false",
423
"x-canonical-non-shaped-icon": "true"},
425
body: "Synchronised contacts-database with cloud-storage.",
426
icon: "image://theme/contacts-app",
429
summaryVisible: true,
432
centeredIconVisible: false,
434
secondaryIconVisible: false,
435
buttonRowVisible: false,
439
valueLabelVisible: false,
443
tag: "Confirmation notification with value",
444
type: Notification.Confirmation,
445
hints: {"x-canonical-non-shaped-icon": "true"},
448
icon: "image://theme/audio-volume-medium",
452
summaryVisible: false,
455
centeredIconVisible: true,
457
secondaryIconVisible: false,
458
buttonRowVisible: false,
462
valueLabelVisible: false,
466
tag: "Confirmation notification with value, label and tint",
467
type: Notification.Confirmation,
468
hints: {"x-canonical-non-shaped-icon": "true",
469
"x-canonical-value-bar-tint" : "true"},
472
icon: "image://theme/audio-volume-high",
476
summaryVisible: false,
479
centeredIconVisible: true,
481
secondaryIconVisible: false,
482
buttonRowVisible: false,
486
valueLabelVisible: true,
495
target: clickThroughCatcher
496
signalName: "clicked"
503
signalName: "actionInvoked"
507
clickThroughSpy.clear()
498
508
actionSpy.clear()
499
waitForRendering(notification)
501
// check if there's a ComboButton created due to more actions being passed
502
if (data.actions.length > 2) {
503
var comboButton = findChild(notification, "notify_button2")
504
tryCompareFunction(function() { return comboButton.expanded == false; }, true);
507
tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == true; }, true);
509
// try clicking on choices in expanded comboList
510
var choiceButton1 = findChild(notification, "notify_button3")
511
tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
512
compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
515
var choiceButton2 = findChild(notification, "notify_button4")
516
tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
517
compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
521
//tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
523
mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
524
compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
511
function test_NotificationRenderer(data) {
512
// populate model with some mock notifications
513
mockModel.append(data)
515
// make sure the view is properly updated before going on
516
notifications.forceLayout();
517
waitForRendering(notifications);
519
var notification = findChild(notifications, "notification" + (mockModel.count - 1))
520
verify(notification !== undefined, "notification wasn't found");
522
waitForRendering(notification);
524
var icon = findChild(notification, "icon")
525
var centeredIcon = findChild(notification, "centeredIcon")
526
var interactiveArea = findChild(notification, "interactiveArea")
527
var secondaryIcon = findChild(notification, "secondaryIcon")
528
var summaryLabel = findChild(notification, "summaryLabel")
529
var bodyLabel = findChild(notification, "bodyLabel")
530
var buttonRow = findChild(notification, "buttonRow")
531
var valueIndicator = findChild(notification, "valueIndicator")
532
var valueLabel = findChild(notification, "valueLabel")
533
var innerBar = findChild(notification, "innerBar")
535
compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
537
compare(icon.shaped, data.shaped, "shaped-status is incorrect")
539
compare(centeredIcon.visible, data.centeredIconVisible, "centered-icon visibility is incorrect")
540
if (centeredIcon.visible) {
541
compare(centeredIcon.shaped, data.shaped, "shaped-status is incorrect")
543
compare(valueIndicator.visible, data.valueVisible, "value-indicator visibility is incorrect")
544
if (valueIndicator.visible) {
545
verify(innerBar.color === data.valueTinted ? UbuntuColors.orange : "white", "value-bar has the wrong color-tint")
547
compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
549
// test input does not fall through
550
mouseClick(notification, notification.width / 2, notification.height / 2)
551
if(data.type == Notification.Interactive) {
553
compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
555
compare(clickThroughSpy.count, 0, "click on notification fell through")
557
compare(secondaryIcon.visible, data.secondaryIconVisible, "secondary-icon visibility is incorrect")
558
compare(summaryLabel.visible, data.summaryVisible, "summary-text visibility is incorrect")
559
compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
560
compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
562
var audioItem = findInvisibleChild(notification, "sound")
563
compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
565
if(data.buttonRowVisible) {
566
var buttonCancel = findChild(buttonRow, "notify_button1")
567
var buttonAccept = findChild(buttonRow, "notify_button0")
569
// only test the left/cancel-button if two actions have been passed in
570
if (data.actions.length == 2) {
571
tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
572
compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
576
// check the tinting of the positive/right button
577
verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
579
// click the positive/right button
580
tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
581
compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
583
waitForRendering (notification)
585
// check if there's a ComboButton created due to more actions being passed
586
if (data.actions.length > 2) {
587
var comboButton = findChild(notification, "notify_button2")
588
tryCompareFunction(function() { return comboButton.expanded == false; }, true);
591
tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == true; }, true);
593
// try clicking on choices in expanded comboList
594
var choiceButton1 = findChild(notification, "notify_button3")
595
tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
596
compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
599
var choiceButton2 = findChild(notification, "notify_button4")
600
tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
601
compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
605
//tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
607
mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
608
compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")