@@ -141,6 +141,18 @@ Item {
141141 mockModel.append(n)
142142 }
143143
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)
153+ mockModel.append(n)
154+ }
155+
144156 function clearNotifications() {
145157 while(mockModel.count > 0) {
146158 remove1stNotification();
@@ -228,6 +240,12 @@ Item {
228240 onClicked: rootRow.add2ndConfirmationNotification()
229241 }
230242
243+ Button {
244+ width: parent.width
245+ text: "add a fullscreen notification"
246+ onClicked: rootRow.addFullscreenNotification()
247+ }
248+
231249 Button {
232250 width: parent.width
233251 text: "remove 1st notification"
@@ -371,6 +389,14 @@ Item {
371389 rawActions: ["ok_id", "Ok",
372390 "snooze_id", "Snooze",
373391 "view_id", "View"]
392+ },
393+ Notification {
394+ nid: 10
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"
399+ fullscreen: true
374400 }
375401 ]
376402
@@ -797,6 +823,50 @@ Item {
797823 tryCompareFunction(function() { return notification2.expanded; }, undefined);
798824 }
799825
826+ function topmostIsFullscreen_data() {
827+ return [{
828+ tag: "Confirmation notification with value",
829+ n: nlist[6]
830+ },
831+ {
832+ tag: "SIM PIN fullscreen notification",
833+ n: nlist[9]
834+ },
835+ {
836+ tag: "Snap Decision without secondary icon and no button-tint",
837+ n: nlist[3]
838+ }]
839+ }
840+
841+ function test_topmostIsFullscreen() {
842+ var data = topmostIsFullscreen_data();
843+
844+ // fill the model
845+ data.forEach(function(notification) {
846+ mockModel.append(notification.n);
847+ notification.n.completed.connect(mockModel.onCompleted);
848+ })
849+
850+ // make sure the view is properly updated before going on
851+ notifications.forceLayout();
852+ waitForRendering(notifications);
853+
854+ // initially, topmost is not fullscreen
855+ verify(!notifications.topmostIsFullscreen)
856+
857+ // close the 1st one, 2nd one should be fullscreen
858+ var notification0 = findChild(notifications, "notification0")
859+ notification0.closeNotification();
860+ waitForRendering(notifications);
861+ verify(notifications.topmostIsFullscreen)
862+
863+ // close the 1st one (SIM PIN) again, topmost should no longer be fullscreen
864+ notification0 = findChild(notifications, "notification0")
865+ notification0.closeNotification();
866+ waitForRendering(notifications);
867+ verify(!notifications.topmostIsFullscreen)
868+ }
869+
800870 function cleanupTestCase() {
801871 notifications.hasMouse = false;
802872 }