@@ -211,6 +211,89 @@ class InteractiveNotificationBase(NotificationsBase):
211211 self.touch.tap_object(notification.select_single(objectName="button4"))
212212 self.assert_notification_action_id_was_called("action_decline_4")
213213
214+ def test_modal_sd_without_greeter (self):
215+ """A snap-decision on a phone should block input to shell beneath it when there's no greeter."""
216+ unity_proxy = self.launch_unity()
217+ unlock_unity(unity_proxy)
218+
219+ summary = "Incoming file"
220+ body = "Frank would like to send you the file: essay.pdf"
221+ icon_path = "sync-idle"
222+ hints = [
223+ ("x-canonical-snap-decisions", "true"),
224+ ("x-canonical-non-shaped-icon", "true"),
225+ ]
226+
227+ actions = [
228+ ('action_accept', 'Accept'),
229+ ('action_decline_1', 'Decline'),
230+ ]
231+
232+ self._create_interactive_notification(
233+ summary,
234+ body,
235+ icon_path,
236+ "NORMAL",
237+ actions,
238+ hints
239+ )
240+
241+ # verify that we cannot reveal the launcher (no longer interact with the shell)
242+ time.sleep(1)
243+ self.main_window.show_dash_swiping()
244+ launcher = self.main_window.get_launcher()
245+ self.assertThat(launcher.shown, Eventually(Equals(False)))
246+
247+ # verify and interact with the triggered snap-decision notification
248+ notify_list = self._get_notifications_list()
249+ get_notification = lambda: notify_list.wait_select_single(
250+ 'Notification', objectName='notification1')
251+ notification = get_notification()
252+ self._assert_notification(notification, summary, body, True, False, 1.0)
253+ self.touch.tap_object(notification.select_single(objectName="button0"))
254+ self.assert_notification_action_id_was_called("action_accept")
255+
256+ def test_modal_sd_with_greeter (self):
257+ """A snap-decision on a phone should not block input to the greeter beneath it."""
258+ unity_proxy = self.launch_unity()
259+
260+ summary = "Incoming file"
261+ body = "Frank would like to send you the file: essay.pdf"
262+ icon_path = "sync-idle"
263+ hints = [
264+ ("x-canonical-snap-decisions", "true"),
265+ ("x-canonical-non-shaped-icon", "true"),
266+ ]
267+
268+ actions = [
269+ ('action_accept', 'Accept'),
270+ ('action_decline_1', 'Decline'),
271+ ]
272+
273+ self._create_interactive_notification(
274+ summary,
275+ body,
276+ icon_path,
277+ "NORMAL",
278+ actions,
279+ hints
280+ )
281+
282+ # verify that we can swipe away the greeter (interact with the "shell")
283+ time.sleep(1)
284+ self.main_window.show_dash_swiping()
285+ greeter = self.main_window.get_greeter()
286+ self.assertThat(greeter.shown, Eventually(Equals(False)))
287+
288+ # verify and interact with the triggered snap-decision notification
289+ notify_list = self._get_notifications_list()
290+ get_notification = lambda: notify_list.wait_select_single(
291+ 'Notification', objectName='notification1')
292+ notification = get_notification()
293+ self._assert_notification(notification, summary, body, True, False, 1.0)
294+ self.touch.tap_object(notification.select_single(objectName="button0"))
295+ self.assert_notification_action_id_was_called("action_accept")
296+
214297 def _create_interactive_notification(
215298 self,
216299 summary="",