@@ -135,10 +135,7 @@ class InteractiveNotificationBase(NotificationsBase):
135135 actions = [("action_id", "dummy")]
136136 hints = [
137137 ("x-canonical-switch-to-application", "true"),
138− (
139− "x-canonical-secondary-icon",
140− self._get_icon_path('applicationIcons/dialer-app.png')
141− )
138+ ("x-canonical-secondary-icon","dialer")
142139 ]
143140
144141 self._create_interactive_notification(
@@ -170,20 +167,19 @@ class InteractiveNotificationBase(NotificationsBase):
170167 body = "Frank Zappa\n+44 (0)7736 027340"
171168 icon_path = self._get_icon_path('avatars/anna_olsson.png')
172169 hints = [
173− (
174− "x-canonical-secondary-icon",
175− self._get_icon_path('applicationIcons/dialer-app.png')
176− ),
170+ ("x-canonical-secondary-icon", "incoming-call"),
177171 ("x-canonical-snap-decisions", "true"),
172+ ("x-canonical-private-affirmative-tint", "true"),
173+ ("x-canonical-private-rejection-tint", "true"),
178174 ]
179175
180176 actions = [
181177 ('action_accept', 'Hold + Answer'),
182178 ('action_decline_1', 'End + Answer'),
183179 ('action_decline_2', 'Decline'),
184− ('action_decline_3', 'messages:I missed your call - can you call me now?'),
185− ('action_decline_4', 'messages:I\'m running late. I\'m on my way.'),
186− ('action_decline_5', 'messages:I\'m busy at the moment. I\'ll call later.'),
180+ ('action_decline_3', 'message:I missed your call - can you call me now?'),
181+ ('action_decline_4', 'message:I\'m running late. I\'m on my way.'),
182+ ('action_decline_5', 'message:I\'m busy at the moment. I\'ll call later.'),
187183 ('action_decline_6', 'edit:Custom'),
188184 ]
189185
@@ -204,13 +200,53 @@ class InteractiveNotificationBase(NotificationsBase):
204200 notification.pointing_device.click_object(
205201 notification.select_single(objectName="combobutton_dropdown"))
206202 self.assertThat(
207− notification.select_single(objectName="button2").expanded,
203+ notification.select_single(objectName="notify_button2").expanded,
208204 Eventually(Equals(True)))
209205 time.sleep(2)
210206 notification.pointing_device.click_object(
211− notification.select_single(objectName="button4"))
207+ notification.select_single(objectName="notify_button4"))
212208 self.assert_notification_action_id_was_called("action_decline_4")
213209
210+
211+ def test_sd_one_over_two_layout(self):
212+ """Snap-decision with three actions should use one-over two button layout."""
213+ unity_proxy = self.launch_unity()
214+ unlock_unity(unity_proxy)
215+
216+ summary = "Theatre at Ferria Stadium"
217+ body = "at Ferria Stadium in Bilbao, Spain\n07578545317"
218+ hints = [
219+ ("x-canonical-snap-decisions", "true"),
220+ ("x-canonical-non-shaped-icon", "true"),
221+ ("x-canonical-private-affirmative-tint", "true")
222+ ]
223+
224+ actions = [
225+ ('action_accept', 'Ok'),
226+ ('action_decline_1', 'Snooze'),
227+ ('action_decline_2', 'View'),
228+ ]
229+
230+ self._create_interactive_notification(
231+ summary,
232+ body,
233+ None,
234+ "NORMAL",
235+ actions,
236+ hints
237+ )
238+
239+ # verify and interact with the triggered snap-decision notification
240+ notify_list = self._get_notifications_list()
241+ get_notification = lambda: notify_list.wait_select_single(
242+ 'Notification', objectName='notification1')
243+ notification = get_notification()
244+ self._assert_notification(
245+ notification, summary, body, False, False, 1.0)
246+ notification.pointing_device.click_object(
247+ notification.select_single(objectName="notify_oot_button0"))
248+ self.assert_notification_action_id_was_called("action_accept")
249+
214250 def test_modal_sd_without_greeter(self):
215251 """Snap-decision should block input to shell without greeter."""
216252 unity_proxy = self.launch_unity()
@@ -222,6 +258,8 @@ class InteractiveNotificationBase(NotificationsBase):
222258 hints = [
223259 ("x-canonical-snap-decisions", "true"),
224260 ("x-canonical-non-shaped-icon", "true"),
261+ ("x-canonical-private-affirmative-tint", "true"),
262+ ("x-canonical-private-rejection-tint", "true"),
225263 ]
226264
227265 actions = [
@@ -253,7 +291,7 @@ class InteractiveNotificationBase(NotificationsBase):
253291 self._assert_notification(
254292 notification, summary, body, True, False, 1.0)
255293 notification.pointing_device.click_object(
256− notification.select_single(objectName="button0"))
294+ notification.select_single(objectName="notify_button0"))
257295 self.assert_notification_action_id_was_called("action_accept")
258296
259297 def test_modal_sd_with_greeter(self):
@@ -266,6 +304,8 @@ class InteractiveNotificationBase(NotificationsBase):
266304 hints = [
267305 ("x-canonical-snap-decisions", "true"),
268306 ("x-canonical-non-shaped-icon", "true"),
307+ ("x-canonical-private-affirmative-tint", "true"),
308+ ("x-canonical-private-rejection-tint", "true"),
269309 ]
270310
271311 actions = [
@@ -296,7 +336,7 @@ class InteractiveNotificationBase(NotificationsBase):
296336 self._assert_notification(
297337 notification, summary, body, True, False, 1.0)
298338 notification.pointing_device.click_object(
299− notification.select_single(objectName="button0"))
339+ notification.select_single(objectName="notify_button0"))
300340 self.assert_notification_action_id_was_called("action_accept")
301341
302342 def _create_interactive_notification(
@@ -438,10 +478,7 @@ class EphemeralNotificationsTests(NotificationsBase):
438478 "join me and Anna?"
439479 icon_path = self._get_icon_path('avatars/anna_olsson.png')
440480 hints = [
441− (
442− "x-canonical-secondary-icon",
443− self._get_icon_path('applicationIcons/dialer-app.png')
444− )
481+ ("x-canonical-secondary-icon", "message")
445482 ]
446483
447484 notification = shell.create_ephemeral_notification(
@@ -474,17 +511,13 @@ class EphemeralNotificationsTests(NotificationsBase):
474511 notify_list = self._get_notifications_list()
475512
476513 summary = "Upload of image completed"
477− hints = [
478− (
479− "x-canonical-secondary-icon",
480− self._get_icon_path('applicationIcons/facebook.png')
481− )
482− ]
514+ icon_path = self._get_icon_path('applicationIcons/facebook.png')
515+ hints=[]
483516
484517 notification = shell.create_ephemeral_notification(
485518 summary,
486519 None,
487− None,
520+ icon_path,
488521 hints,
489522 "NORMAL",
490523 )
@@ -497,8 +530,8 @@ class EphemeralNotificationsTests(NotificationsBase):
497530 notification(),
498531 summary,
499532 None,
500− False,
501533 True,
534+ False,
502535 1.0
503536 )
504537
@@ -683,7 +716,7 @@ class EphemeralNotificationsTests(NotificationsBase):
683716 body = 'This bubble uses the icon-title-body layout with a ' \
684717 'secondary icon.'
685718 icon_path = self._get_icon_path('avatars/anna_olsson.png')
686− hint_icon = self._get_icon_path('applicationIcons/dialer-app.png')
719+ hint_icon = 'dialer'
687720
688721 notification = shell.create_ephemeral_notification(
689722 summary,
@@ -718,72 +751,3 @@ class EphemeralNotificationsTests(NotificationsBase):
718751 self.assertThat(get_notification, Eventually(NotEquals(None)))
719752 self._assert_notification(
720753 get_notification(), summary, body, False, False, 1.0)
721−
722− def test_append_hint(self):
723− """Notification has to accumulate body-text using append-hint."""
724− unity_proxy = self.launch_unity()
725− unlock_unity(unity_proxy)
726−
727− notify_list = self._get_notifications_list()
728−
729− summary = 'Cole Raby'
730− body = 'Hey Bro Coly!'
731− icon_path = self._get_icon_path('avatars/amanda.png')
732− body_sum = body
733− notification = shell.create_ephemeral_notification(
734− summary,
735− body,
736− icon_path,
737− hints=[('x-canonical-append', 'true')]
738− )
739−
740− notification.show()
741−
742− get_notification = lambda: notify_list.wait_select_single(
743− 'Notification', objectName='notification1')
744−
745− notification = get_notification()
746− self._assert_notification(
747− notification,
748− summary,
749− body_sum,
750− True,
751− False,
752− 1.0
753− )
754−
755− bodies = [
756− 'What\'s up dude?',
757− 'Did you watch the air-race in Oshkosh last week?',
758− 'Phil owned the place like no one before him!',
759− 'Did really everything in the race work according to regulations?',
760− 'Somehow I think to remember Burt Williams did cut corners and '
761− 'was not punished for this.',
762− 'Hopefully the referees will watch the videos of the race.',
763− 'Burt could get fined with US$ 50000 for that rule-violation :)'
764− ]
765−
766− for new_body in bodies:
767− body = new_body
768− body_sum += '\n' + body
769− notification = shell.create_ephemeral_notification(
770− summary,
771− body,
772− icon_path,
773− hints=[('x-canonical-append', 'true')]
774− )
775− notification.show()
776−
777− get_notification = lambda: notify_list.wait_select_single(
778− 'Notification',
779− objectName='notification1'
780− )
781− notification = get_notification()
782− self._assert_notification(
783− notification,
784− summary,
785− body_sum,
786− True,
787− False,
788− 1.0
789− )