@@ -322,8 +322,9 @@ Rectangle {
322322
323323 function loadDesktopShellWithApps() {
324324 loadShell("desktop");
325+ waitForRendering(shell)
325326 shell.usageScenario = "desktop"
326− waitForRendering(root)
327+ waitForRendering(shell)
327328 var app1 = ApplicationManager.startApplication("dialer-app")
328329 var app2 = ApplicationManager.startApplication("webbrowser-app")
329330 var app3 = ApplicationManager.startApplication("camera-app")
@@ -1407,17 +1408,18 @@ Rectangle {
14071408 keyClick(Qt.Key_Tab, Qt.ControlModifier)
14081409 tryCompare(app2.session.surface, "activeFocus", true)
14091410
1411+ var desktopSpread = findChild(shell, "spread")
14101412
1411− tryCompare(desktopStage, "state", "")
1413+ tryCompare(desktopSpread, "state", "")
14121414
14131415 // Just press Alt, make sure the spread comes up
14141416 keyPress(Qt.Key_Control);
14151417 keyClick(Qt.Key_Tab);
1416− tryCompare(desktopStage, "state", "altTab")
1418+ tryCompare(desktopSpread, "state", "altTab")
14171419
14181420 // Release control, check if spread disappears
14191421 keyRelease(Qt.Key_Control)
1420− tryCompare(desktopStage, "state", "")
1422+ tryCompare(desktopSpread, "state", "")
14211423
14221424 // Focus should have switched back now
14231425 tryCompare(app3.session.surface, "activeFocus", true)
@@ -1429,41 +1431,44 @@ Rectangle {
14291431 var desktopStage = findChild(shell, "stage");
14301432 verify(desktopStage !== null)
14311433
1432− var appContainer = findInvisibleChild(shell, "appContainer")
1433− verify(appContainer !== null)
1434+ var desktopSpread = findChild(shell, "spread");
1435+ verify(desktopSpread !== null)
14341436
1435− var appRepeater = findInvisibleChild(shell, "appRepeater")
1436− verify(appRepeater !== null)
1437+ var spreadContainer = findInvisibleChild(shell, "spreadContainer")
1438+ verify(spreadContainer !== null)
1439+
1440+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater")
1441+ verify(spreadRepeater !== null)
14371442
14381443 // remember the focused appId
14391444 var focused = ApplicationManager.get(ApplicationManager.findApplication(ApplicationManager.focusedApplicationId));
14401445
1441− tryCompare(desktopStage, "state", "")
1446+ tryCompare(desktopSpread, "state", "")
14421447
14431448 // Just press Alt, make sure the spread comes up
14441449 keyPress(Qt.Key_Control);
14451450 keyClick(Qt.Key_Tab);
1446− tryCompare(desktopStage, "state", "altTab")
1447− tryCompare(appRepeater, "highlightedIndex", 1)
1451+ tryCompare(desktopSpread, "state", "altTab")
1452+ tryCompare(spreadRepeater, "highlightedIndex", 1)
14481453 waitForRendering(shell)
14491454
14501455 // Now press and hold Tab, make sure the highlight moves all the way but stops at the last one
14511456 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
14521457 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
14531458 for (var i = 0; i < 10; i++) {
1454− appContainer.selectNext(true); // true == isAutoRepeat
1459+ desktopSpread.selectNext(true); // true == isAutoRepeat
14551460 wait(0); // Trigger the event loop to make sure all the things happen
14561461 }
1457− tryCompare(appRepeater, "highlightedIndex", 6)
1462+ tryCompare(spreadRepeater, "highlightedIndex", 6)
14581463
14591464 // Now release it once, and verify that it does wrap around with an additional Tab press
14601465 keyRelease(Qt.Key_Tab);
14611466 keyClick(Qt.Key_Tab);
1462− tryCompare(appRepeater, "highlightedIndex", 0)
1467+ tryCompare(spreadRepeater, "highlightedIndex", 0)
14631468
14641469 // Release control, check if spread disappears
14651470 keyRelease(Qt.Key_Control)
1466− tryCompare(desktopStage, "state", "")
1471+ tryCompare(desktopSpread, "state", "")
14671472
14681473 // Make sure that after wrapping around once, we have the same one focused as at the beginning
14691474 tryCompare(focused.session.surface, "activeFocus", true)
@@ -1472,30 +1477,30 @@ Rectangle {
14721477 function test_altBackTabNavigation() {
14731478 loadDesktopShellWithApps();
14741479
1475− var appRepeater = findInvisibleChild(shell, "appRepeater");
1476− verify(appRepeater !== null);
1480+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1481+ verify(spreadRepeater !== null);
14771482
14781483 keyPress(Qt.Key_Control)
14791484 keyClick(Qt.Key_Tab);
1480− tryCompare(appRepeater, "highlightedIndex", 1);
1485+ tryCompare(spreadRepeater, "highlightedIndex", 1);
14811486
14821487 keyClick(Qt.Key_Tab);
1483− tryCompare(appRepeater, "highlightedIndex", 2);
1488+ tryCompare(spreadRepeater, "highlightedIndex", 2);
14841489
14851490 keyClick(Qt.Key_Tab);
1486− tryCompare(appRepeater, "highlightedIndex", 3);
1491+ tryCompare(spreadRepeater, "highlightedIndex", 3);
14871492
14881493 keyClick(Qt.Key_Tab);
1489− tryCompare(appRepeater, "highlightedIndex", 4);
1494+ tryCompare(spreadRepeater, "highlightedIndex", 4);
14901495
14911496 keyClick(Qt.Key_Backtab);
1492− tryCompare(appRepeater, "highlightedIndex", 3);
1497+ tryCompare(spreadRepeater, "highlightedIndex", 3);
14931498
14941499 keyClick(Qt.Key_Backtab);
1495− tryCompare(appRepeater, "highlightedIndex", 2);
1500+ tryCompare(spreadRepeater, "highlightedIndex", 2);
14961501
14971502 keyClick(Qt.Key_Backtab);
1498− tryCompare(appRepeater, "highlightedIndex", 1);
1503+ tryCompare(spreadRepeater, "highlightedIndex", 1);
14991504
15001505 keyRelease(Qt.Key_Control);
15011506 }
@@ -1503,20 +1508,20 @@ Rectangle {
15031508 function test_highlightFollowsMouse() {
15041509 loadDesktopShellWithApps()
15051510
1506− var appRepeater = findInvisibleChild(shell, "appRepeater");
1507− verify(appRepeater !== null);
1511+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1512+ verify(spreadRepeater !== null);
15081513
15091514 keyPress(Qt.Key_Control)
15101515 keyClick(Qt.Key_Tab);
15111516
1512− tryCompare(appRepeater, "highlightedIndex", 1);
1517+ tryCompare(spreadRepeater, "highlightedIndex", 1);
15131518
15141519 var x = 0;
15151520 var y = shell.height * .75;
15161521 mouseMove(shell, x, y)
15171522
15181523 for (var i = 0; i < 7; i++) {
1519− while (appRepeater.highlightedIndex != i && x <= 4000) {
1524+ while (spreadRepeater.highlightedIndex != i && x <= 4000) {
15201525 x+=10;
15211526 mouseMove(shell, x, y)
15221527 wait(0); // spin the loop so bindings get evaluated
@@ -1531,8 +1536,8 @@ Rectangle {
15311536 function test_closeFromSpread() {
15321537 loadDesktopShellWithApps()
15331538
1534− var appRepeater = findInvisibleChild(shell, "appRepeater");
1535− verify(appRepeater !== null);
1539+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1540+ verify(spreadRepeater !== null);
15361541
15371542 keyPress(Qt.Key_Control)
15381543 keyClick(Qt.Key_Tab);
@@ -1540,14 +1545,14 @@ Rectangle {
15401545 appRemovedSpy.clear();
15411546
15421547 var closedAppId = ApplicationManager.get(2).appId;
1543− var appDelegate2 = appRepeater.itemAt(2);
1544− var closeMouseArea = findChild(appDelegate2, "closeMouseArea");
1548+ var spreadDelegate2 = spreadRepeater.itemAt(2);
1549+ var closeMouseArea = findChild(spreadDelegate2, "closeMouseArea");
15451550
15461551 // Move the mosue over tile 2 and verify the close button becomes visible
15471552 var x = 0;
15481553 var y = shell.height * .5;
15491554 mouseMove(shell, x, y)
1550− while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1555+ while (spreadRepeater.highlightedIndex !== 2 && x <= 4000) {
15511556 x+=10;
15521557 mouseMove(shell, x, y)
15531558 wait(0); // spin the loop so bindings get evaluated
@@ -1594,7 +1599,7 @@ Rectangle {
15941599 var x = 0;
15951600 var y = shell.height * (data.tileInfo ? .95 : 0.5)
15961601 mouseMove(shell, x, y)
1597− while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1602+ while (spreadRepeater.highlightedIndex !== 2 && x <= 4000) {
15981603 x+=10;
15991604 mouseMove(shell, x, y)
16001605 wait(0); // spin the loop so bindings get evaluated