@@ -141,6 +141,18 @@ Item {
141 mockModel.append(n)
141 mockModel.append(n)
144+ function addFullscreenNotification() {
145+ var component = Qt.createComponent("Notification.qml")
146+ var n = component.createObject("notification", {"nid": index++,
147+ "type": Notification.SnapDecision,
148+ "hints": {"x-canonical-private-affirmative-tint": "true"},
149+ "summary": "SIM PIN screen",
150+ "body": "Enter your PIN to unlock the SIM",
151+ "fullscreen": true})
152+ n.completed.connect(mockModel.onCompleted)
144 function clearNotifications() {
156 function clearNotifications() {
145 while(mockModel.count > 0) {
157 while(mockModel.count > 0) {
146 remove1stNotification();
158 remove1stNotification();
@@ -228,6 +240,12 @@ Item {
228 onClicked: rootRow.add2ndConfirmationNotification()
240 onClicked: rootRow.add2ndConfirmationNotification()
245+ text: "add a fullscreen notification"
246+ onClicked: rootRow.addFullscreenNotification()
232 width: parent.width
250 width: parent.width
233 text: "remove 1st notification"
251 text: "remove 1st notification"
@@ -371,6 +389,14 @@ Item {
371 rawActions: ["ok_id", "Ok",
389 rawActions: ["ok_id", "Ok",
372 "snooze_id", "Snooze",
390 "snooze_id", "Snooze",
373 "view_id", "View"]
391 "view_id", "View"]
395+ type: Notification.SnapDecision
396+ hints: {"x-canonical-private-affirmative-tint": "true"}
397+ summary: "SIM PIN screen"
398+ body: "Enter your PIN to unlock the SIM"
@@ -538,15 +564,12 @@ Item {
538 signalName: "actionInvoked"
564 signalName: "actionInvoked"
542− while (mockModel.count > 0) {
543− mockModel.remove(0);
547 function cleanup() {
567 function cleanup() {
548 clickThroughSpy.clear()
568 clickThroughSpy.clear()
549 actionSpy.clear()
569 actionSpy.clear()
570+ while (mockModel.count > 0) {
571+ mockModel.removeFirst();
552 function test_NotificationRenderer(data) {
575 function test_NotificationRenderer(data) {
@@ -797,6 +820,50 @@ Item {
797 tryCompareFunction(function() { return notification2.expanded; }, undefined);
820 tryCompareFunction(function() { return notification2.expanded; }, undefined);
823+ function topmostIsFullscreen_data() {
825+ tag: "Confirmation notification with value",
829+ tag: "SIM PIN fullscreen notification",
833+ tag: "Snap Decision without secondary icon and no button-tint",
838+ function test_topmostIsFullscreen() {
839+ var data = topmostIsFullscreen_data();
842+ data.forEach(function(notification) {
843+ mockModel.append(notification.n);
844+ notification.n.completed.connect(mockModel.onCompleted);
847+ // make sure the view is properly updated before going on
848+ notifications.forceLayout();
849+ waitForRendering(notifications);
851+ // initially, topmost is not fullscreen
852+ verify(!notifications.topmostIsFullscreen)
854+ // close the 1st one, 2nd one should be fullscreen
855+ var notification0 = findChild(notifications, "notification0")
856+ notification0.closeNotification();
857+ waitForRendering(notifications);
858+ verify(notifications.topmostIsFullscreen)
860+ // close the 1st one (SIM PIN) again, topmost should no longer be fullscreen
861+ notification0 = findChild(notifications, "notification0")
862+ notification0.closeNotification();
863+ waitForRendering(notifications);
864+ verify(!notifications.topmostIsFullscreen)
800 function cleanupTestCase() {
867 function cleanupTestCase() {
801 notifications.hasMouse = false;
868 notifications.hasMouse = false;