@@ -286,6 +286,12 @@ Rectangle {
286286 signalName: "actionInvoked"
287287 }
288288
289+ SignalSpy {
290+ id: appRemovedSpy
291+ target: ApplicationManager
292+ signalName: "applicationRemoved"
293+ }
294+
289295 Telephony.CallEntry {
290296 id: phoneCall
291297 phoneNumber: "+447812221111"
@@ -1443,5 +1449,41 @@ Rectangle {
14431449
14441450 keyRelease(Qt.Key_Control);
14451451 }
1452+
1453+ function test_closeFromSpread() {
1454+ loadDesktopShellWithApps()
1455+
1456+ var appRepeater = findInvisibleChild(shell, "appRepeater");
1457+ verify(appRepeater !== null);
1458+
1459+ keyPress(Qt.Key_Control)
1460+ keyClick(Qt.Key_Tab);
1461+
1462+ appRemovedSpy.clear();
1463+
1464+ var closedAppId = ApplicationManager.get(2).appId;
1465+ var appDelegate2 = appRepeater.itemAt(2);
1466+ var closeMouseArea = findChild(appDelegate2, "closeMouseArea");
1467+
1468+ // Move the mosue over tile 2 and verify the close button becomes visible
1469+ var x = 0;
1470+ var y = shell.height * .5;
1471+ mouseMove(shell, x, y)
1472+ while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1473+ x+=10;
1474+ mouseMove(shell, x, y)
1475+ waitForRendering(shell)
1476+ }
1477+ tryCompare(closeMouseArea, "enabled", true)
1478+
1479+ // Close the app using the close button
1480+ mouseClick(closeMouseArea, closeMouseArea.width / 2, closeMouseArea.height / 2)
1481+
1482+ // Verify applicationRemoved has been emitted correctly
1483+ tryCompare(appRemovedSpy, "count", 1)
1484+ compare(appRemovedSpy.signalArguments[0][0], closedAppId);
1485+
1486+ keyRelease(Qt.Key_Control);
1487+ }
14461488 }
14471489}