@@ -135,10 +135,7 @@ class InteractiveNotificationBase(NotificationsBase):
135 actions = [("action_id", "dummy")]
135 actions = [("action_id", "dummy")]
136 hints = [
136 hints = [
137 ("x-canonical-switch-to-application", "true"),
137 ("x-canonical-switch-to-application", "true"),
139− "x-canonical-secondary-icon",
138+ ("x-canonical-secondary-icon","dialer")
140− self._get_icon_path('applicationIcons/dialer-app.png')
144 self._create_interactive_notification(
141 self._create_interactive_notification(
@@ -170,20 +167,19 @@ class InteractiveNotificationBase(NotificationsBase):
170 body = "Frank Zappa\n+44 (0)7736 027340"
167 body = "Frank Zappa\n+44 (0)7736 027340"
171 icon_path = self._get_icon_path('avatars/anna_olsson.png')
168 icon_path = self._get_icon_path('avatars/anna_olsson.png')
172 hints = [
169 hints = [
174− "x-canonical-secondary-icon",
170+ ("x-canonical-secondary-icon", "incoming-call"),
175− self._get_icon_path('applicationIcons/dialer-app.png')
177 ("x-canonical-snap-decisions", "true"),
171 ("x-canonical-snap-decisions", "true"),
172+ ("x-canonical-private-affirmative-tint", "true"),
173+ ("x-canonical-private-rejection-tint", "true"),
180 actions = [
176 actions = [
181 ('action_accept', 'Hold + Answer'),
177 ('action_accept', 'Hold + Answer'),
182 ('action_decline_1', 'End + Answer'),
178 ('action_decline_1', 'End + Answer'),
183 ('action_decline_2', 'Decline'),
179 ('action_decline_2', 'Decline'),
184− ('action_decline_3', 'messages:I missed your call - can you call me now?'),
180+ ('action_decline_3', 'message:I missed your call - can you call me now?'),
185− ('action_decline_4', 'messages:I\'m running late. I\'m on my way.'),
181+ ('action_decline_4', 'message:I\'m running late. I\'m on my way.'),
186− ('action_decline_5', 'messages:I\'m busy at the moment. I\'ll call later.'),
182+ ('action_decline_5', 'message:I\'m busy at the moment. I\'ll call later.'),
187 ('action_decline_6', 'edit:Custom'),
183 ('action_decline_6', 'edit:Custom'),
@@ -204,13 +200,60 @@ class InteractiveNotificationBase(NotificationsBase):
204 notification.pointing_device.click_object(
200 notification.pointing_device.click_object(
205 notification.select_single(objectName="combobutton_dropdown"))
201 notification.select_single(objectName="combobutton_dropdown"))
206 self.assertThat(
202 self.assertThat(
207− notification.select_single(objectName="button2").expanded,
203+ notification.select_single(objectName="notify_button2").expanded,
208 Eventually(Equals(True)))
204 Eventually(Equals(True)))
209 time.sleep(2)
205 time.sleep(2)
210 notification.pointing_device.click_object(
206 notification.pointing_device.click_object(
211− notification.select_single(objectName="button4"))
207+ notification.select_single(objectName="notify_button4"))
212 self.assert_notification_action_id_was_called("action_decline_4")
208 self.assert_notification_action_id_was_called("action_decline_4")
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)
216+ summary = "Theatre at Ferria Stadium"
217+ body = "at Ferria Stadium in Bilbao, Spain\n07578545317"
219+ ("x-canonical-snap-decisions", "true"),
220+ ("x-canonical-non-shaped-icon", "true"),
221+ ("x-canonical-private-affirmative-tint", "true")
225+ ('action_accept', 'Ok'),
226+ ('action_decline_1', 'Snooze'),
227+ ('action_decline_2', 'View'),
230+ self._create_interactive_notification(
239+ # verify that we cannot reveal the launcher (no longer interact with
242+ self.main_window.show_dash_swiping()
243+ launcher = self.main_window.get_launcher()
244+ self.assertThat(launcher.shown, Eventually(Equals(False)))
246+ # verify and interact with the triggered snap-decision notification
247+ notify_list = self._get_notifications_list()
248+ get_notification = lambda: notify_list.wait_select_single(
249+ 'Notification', objectName='notification1')
250+ notification = get_notification()
251+ self._assert_notification(
252+ notification, summary, body, False, False, 1.0)
253+ notification.pointing_device.click_object(
254+ notification.select_single(objectName="notify_oot_button0"))
255+ self.assert_notification_action_id_was_called("action_accept")
214 def test_modal_sd_without_greeter(self):
257 def test_modal_sd_without_greeter(self):
215 """Snap-decision should block input to shell without greeter."""
258 """Snap-decision should block input to shell without greeter."""
216 unity_proxy = self.launch_unity()
259 unity_proxy = self.launch_unity()
@@ -222,6 +265,8 @@ class InteractiveNotificationBase(NotificationsBase):
222 hints = [
265 hints = [
223 ("x-canonical-snap-decisions", "true"),
266 ("x-canonical-snap-decisions", "true"),
224 ("x-canonical-non-shaped-icon", "true"),
267 ("x-canonical-non-shaped-icon", "true"),
268+ ("x-canonical-private-affirmative-tint", "true"),
269+ ("x-canonical-private-rejection-tint", "true"),
227 actions = [
272 actions = [
@@ -253,7 +298,7 @@ class InteractiveNotificationBase(NotificationsBase):
253 self._assert_notification(
298 self._assert_notification(
254 notification, summary, body, True, False, 1.0)
299 notification, summary, body, True, False, 1.0)
255 notification.pointing_device.click_object(
300 notification.pointing_device.click_object(
256− notification.select_single(objectName="button0"))
301+ notification.select_single(objectName="notify_button0"))
257 self.assert_notification_action_id_was_called("action_accept")
302 self.assert_notification_action_id_was_called("action_accept")
259 def test_modal_sd_with_greeter(self):
304 def test_modal_sd_with_greeter(self):
@@ -266,6 +311,8 @@ class InteractiveNotificationBase(NotificationsBase):
266 hints = [
311 hints = [
267 ("x-canonical-snap-decisions", "true"),
312 ("x-canonical-snap-decisions", "true"),
268 ("x-canonical-non-shaped-icon", "true"),
313 ("x-canonical-non-shaped-icon", "true"),
314+ ("x-canonical-private-affirmative-tint", "true"),
315+ ("x-canonical-private-rejection-tint", "true"),
271 actions = [
318 actions = [
@@ -296,7 +343,7 @@ class InteractiveNotificationBase(NotificationsBase):
296 self._assert_notification(
343 self._assert_notification(
297 notification, summary, body, True, False, 1.0)
344 notification, summary, body, True, False, 1.0)
298 notification.pointing_device.click_object(
345 notification.pointing_device.click_object(
299− notification.select_single(objectName="button0"))
346+ notification.select_single(objectName="notify_button0"))
300 self.assert_notification_action_id_was_called("action_accept")
347 self.assert_notification_action_id_was_called("action_accept")
302 def _create_interactive_notification(
349 def _create_interactive_notification(
@@ -438,10 +485,7 @@ class EphemeralNotificationsTests(NotificationsBase):
438 "join me and Anna?"
485 "join me and Anna?"
439 icon_path = self._get_icon_path('avatars/anna_olsson.png')
486 icon_path = self._get_icon_path('avatars/anna_olsson.png')
440 hints = [
487 hints = [
442− "x-canonical-secondary-icon",
488+ ("x-canonical-secondary-icon", "message")
443− self._get_icon_path('applicationIcons/dialer-app.png')
447 notification = shell.create_ephemeral_notification(
491 notification = shell.create_ephemeral_notification(
@@ -474,17 +518,13 @@ class EphemeralNotificationsTests(NotificationsBase):
474 notify_list = self._get_notifications_list()
518 notify_list = self._get_notifications_list()
476 summary = "Upload of image completed"
520 summary = "Upload of image completed"
479− "x-canonical-secondary-icon",
480− self._get_icon_path('applicationIcons/facebook.png')
521+ icon_path = self._get_icon_path('applicationIcons/facebook.png')
484 notification = shell.create_ephemeral_notification(
524 notification = shell.create_ephemeral_notification(
487− None,
527+ icon_path,
489 "NORMAL",
529 "NORMAL",
@@ -497,8 +537,8 @@ class EphemeralNotificationsTests(NotificationsBase):
497 notification(),
537 notification(),
@@ -683,7 +723,7 @@ class EphemeralNotificationsTests(NotificationsBase):
683 body = 'This bubble uses the icon-title-body layout with a ' \
723 body = 'This bubble uses the icon-title-body layout with a ' \
684 'secondary icon.'
724 'secondary icon.'
685 icon_path = self._get_icon_path('avatars/anna_olsson.png')
725 icon_path = self._get_icon_path('avatars/anna_olsson.png')
686− hint_icon = self._get_icon_path('applicationIcons/dialer-app.png')
726+ hint_icon = 'dialer'
688 notification = shell.create_ephemeral_notification(
728 notification = shell.create_ephemeral_notification(