@@ -322,8 +322,9 @@ Rectangle {
323 function loadDesktopShellWithApps() {
323 function loadDesktopShellWithApps() {
324 loadShell("desktop");
324 loadShell("desktop");
325+ waitForRendering(shell)
325 shell.usageScenario = "desktop"
326 shell.usageScenario = "desktop"
326− waitForRendering(root)
327+ waitForRendering(shell)
327 var app1 = ApplicationManager.startApplication("dialer-app")
328 var app1 = ApplicationManager.startApplication("dialer-app")
328 var app2 = ApplicationManager.startApplication("webbrowser-app")
329 var app2 = ApplicationManager.startApplication("webbrowser-app")
329 var app3 = ApplicationManager.startApplication("camera-app")
330 var app3 = ApplicationManager.startApplication("camera-app")
@@ -1407,17 +1408,18 @@ Rectangle {
1407 keyClick(Qt.Key_Tab, Qt.ControlModifier)
1408 keyClick(Qt.Key_Tab, Qt.ControlModifier)
1408 tryCompare(app2.session.surface, "activeFocus", true)
1409 tryCompare(app2.session.surface, "activeFocus", true)
1411+ var desktopSpread = findChild(shell, "spread")
1411− tryCompare(desktopStage, "state", "")
1413+ tryCompare(desktopSpread, "state", "")
1413 // Just press Alt, make sure the spread comes up
1415 // Just press Alt, make sure the spread comes up
1414 keyPress(Qt.Key_Control);
1416 keyPress(Qt.Key_Control);
1415 keyClick(Qt.Key_Tab);
1417 keyClick(Qt.Key_Tab);
1416− tryCompare(desktopStage, "state", "altTab")
1418+ tryCompare(desktopSpread, "state", "altTab")
1418 // Release control, check if spread disappears
1420 // Release control, check if spread disappears
1419 keyRelease(Qt.Key_Control)
1421 keyRelease(Qt.Key_Control)
1420− tryCompare(desktopStage, "state", "")
1422+ tryCompare(desktopSpread, "state", "")
1422 // Focus should have switched back now
1424 // Focus should have switched back now
1423 tryCompare(app3.session.surface, "activeFocus", true)
1425 tryCompare(app3.session.surface, "activeFocus", true)
@@ -1429,41 +1431,44 @@ Rectangle {
1429 var desktopStage = findChild(shell, "stage");
1431 var desktopStage = findChild(shell, "stage");
1430 verify(desktopStage !== null)
1432 verify(desktopStage !== null)
1432− var appContainer = findInvisibleChild(shell, "appContainer")
1434+ var desktopSpread = findChild(shell, "spread");
1433− verify(appContainer !== null)
1435+ verify(desktopSpread !== null)
1437+ var spreadContainer = findInvisibleChild(shell, "spreadContainer")
1438+ verify(spreadContainer !== null)
1435− var appRepeater = findInvisibleChild(shell, "appRepeater")
1440+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater")
1436− verify(appRepeater !== null)
1441+ verify(spreadRepeater !== null)
1438 // remember the focused appId
1443 // remember the focused appId
1439 var focused = ApplicationManager.get(ApplicationManager.findApplication(ApplicationManager.focusedApplicationId));
1444 var focused = ApplicationManager.get(ApplicationManager.findApplication(ApplicationManager.focusedApplicationId));
1441− tryCompare(desktopStage, "state", "")
1446+ tryCompare(desktopSpread, "state", "")
1443 // Just press Alt, make sure the spread comes up
1448 // Just press Alt, make sure the spread comes up
1444 keyPress(Qt.Key_Control);
1449 keyPress(Qt.Key_Control);
1445 keyClick(Qt.Key_Tab);
1450 keyClick(Qt.Key_Tab);
1446− tryCompare(desktopStage, "state", "altTab")
1451+ tryCompare(desktopSpread, "state", "altTab")
1447− tryCompare(appRepeater, "highlightedIndex", 1)
1452+ tryCompare(spreadRepeater, "highlightedIndex", 1)
1448 waitForRendering(shell)
1453 waitForRendering(shell)
1450 // Now press and hold Tab, make sure the highlight moves all the way but stops at the last one
1455 // Now press and hold Tab, make sure the highlight moves all the way but stops at the last one
1451 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
1456 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
1452 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
1457 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
1453 for (var i = 0; i < 10; i++) {
1458 for (var i = 0; i < 10; i++) {
1454− appContainer.selectNext(true); // true == isAutoRepeat
1459+ desktopSpread.selectNext(true); // true == isAutoRepeat
1455 wait(0); // Trigger the event loop to make sure all the things happen
1460 wait(0); // Trigger the event loop to make sure all the things happen
1457− tryCompare(appRepeater, "highlightedIndex", 6)
1462+ tryCompare(spreadRepeater, "highlightedIndex", 6)
1459 // Now release it once, and verify that it does wrap around with an additional Tab press
1464 // Now release it once, and verify that it does wrap around with an additional Tab press
1460 keyRelease(Qt.Key_Tab);
1465 keyRelease(Qt.Key_Tab);
1461 keyClick(Qt.Key_Tab);
1466 keyClick(Qt.Key_Tab);
1462− tryCompare(appRepeater, "highlightedIndex", 0)
1467+ tryCompare(spreadRepeater, "highlightedIndex", 0)
1464 // Release control, check if spread disappears
1469 // Release control, check if spread disappears
1465 keyRelease(Qt.Key_Control)
1470 keyRelease(Qt.Key_Control)
1466− tryCompare(desktopStage, "state", "")
1471+ tryCompare(desktopSpread, "state", "")
1468 // Make sure that after wrapping around once, we have the same one focused as at the beginning
1473 // Make sure that after wrapping around once, we have the same one focused as at the beginning
1469 tryCompare(focused.session.surface, "activeFocus", true)
1474 tryCompare(focused.session.surface, "activeFocus", true)
@@ -1472,30 +1477,30 @@ Rectangle {
1472 function test_altBackTabNavigation() {
1477 function test_altBackTabNavigation() {
1473 loadDesktopShellWithApps();
1478 loadDesktopShellWithApps();
1475− var appRepeater = findInvisibleChild(shell, "appRepeater");
1480+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1476− verify(appRepeater !== null);
1481+ verify(spreadRepeater !== null);
1478 keyPress(Qt.Key_Control)
1483 keyPress(Qt.Key_Control)
1479 keyClick(Qt.Key_Tab);
1484 keyClick(Qt.Key_Tab);
1480− tryCompare(appRepeater, "highlightedIndex", 1);
1485+ tryCompare(spreadRepeater, "highlightedIndex", 1);
1482 keyClick(Qt.Key_Tab);
1487 keyClick(Qt.Key_Tab);
1483− tryCompare(appRepeater, "highlightedIndex", 2);
1488+ tryCompare(spreadRepeater, "highlightedIndex", 2);
1485 keyClick(Qt.Key_Tab);
1490 keyClick(Qt.Key_Tab);
1486− tryCompare(appRepeater, "highlightedIndex", 3);
1491+ tryCompare(spreadRepeater, "highlightedIndex", 3);
1488 keyClick(Qt.Key_Tab);
1493 keyClick(Qt.Key_Tab);
1489− tryCompare(appRepeater, "highlightedIndex", 4);
1494+ tryCompare(spreadRepeater, "highlightedIndex", 4);
1491 keyClick(Qt.Key_Backtab);
1496 keyClick(Qt.Key_Backtab);
1492− tryCompare(appRepeater, "highlightedIndex", 3);
1497+ tryCompare(spreadRepeater, "highlightedIndex", 3);
1494 keyClick(Qt.Key_Backtab);
1499 keyClick(Qt.Key_Backtab);
1495− tryCompare(appRepeater, "highlightedIndex", 2);
1500+ tryCompare(spreadRepeater, "highlightedIndex", 2);
1497 keyClick(Qt.Key_Backtab);
1502 keyClick(Qt.Key_Backtab);
1498− tryCompare(appRepeater, "highlightedIndex", 1);
1503+ tryCompare(spreadRepeater, "highlightedIndex", 1);
1500 keyRelease(Qt.Key_Control);
1505 keyRelease(Qt.Key_Control);
@@ -1503,20 +1508,20 @@ Rectangle {
1503 function test_highlightFollowsMouse() {
1508 function test_highlightFollowsMouse() {
1504 loadDesktopShellWithApps()
1509 loadDesktopShellWithApps()
1506− var appRepeater = findInvisibleChild(shell, "appRepeater");
1511+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1507− verify(appRepeater !== null);
1512+ verify(spreadRepeater !== null);
1509 keyPress(Qt.Key_Control)
1514 keyPress(Qt.Key_Control)
1510 keyClick(Qt.Key_Tab);
1515 keyClick(Qt.Key_Tab);
1512− tryCompare(appRepeater, "highlightedIndex", 1);
1517+ tryCompare(spreadRepeater, "highlightedIndex", 1);
1514 var x = 0;
1519 var x = 0;
1515 var y = shell.height * .75;
1520 var y = shell.height * .75;
1516 mouseMove(shell, x, y)
1521 mouseMove(shell, x, y)
1518 for (var i = 0; i < 7; i++) {
1523 for (var i = 0; i < 7; i++) {
1519− while (appRepeater.highlightedIndex != i && x <= 4000) {
1524+ while (spreadRepeater.highlightedIndex != i && x <= 4000) {
1521 mouseMove(shell, x, y)
1526 mouseMove(shell, x, y)
1522 wait(0); // spin the loop so bindings get evaluated
1527 wait(0); // spin the loop so bindings get evaluated
@@ -1531,8 +1536,8 @@ Rectangle {
1531 function test_closeFromSpread() {
1536 function test_closeFromSpread() {
1532 loadDesktopShellWithApps()
1537 loadDesktopShellWithApps()
1534− var appRepeater = findInvisibleChild(shell, "appRepeater");
1539+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1535− verify(appRepeater !== null);
1540+ verify(spreadRepeater !== null);
1537 keyPress(Qt.Key_Control)
1542 keyPress(Qt.Key_Control)
1538 keyClick(Qt.Key_Tab);
1543 keyClick(Qt.Key_Tab);
@@ -1540,14 +1545,14 @@ Rectangle {
1540 appRemovedSpy.clear();
1545 appRemovedSpy.clear();
1542 var closedAppId = ApplicationManager.get(2).appId;
1547 var closedAppId = ApplicationManager.get(2).appId;
1543− var appDelegate2 = appRepeater.itemAt(2);
1548+ var spreadDelegate2 = spreadRepeater.itemAt(2);
1544− var closeMouseArea = findChild(appDelegate2, "closeMouseArea");
1549+ var closeMouseArea = findChild(spreadDelegate2, "closeMouseArea");
1546 // Move the mosue over tile 2 and verify the close button becomes visible
1551 // Move the mosue over tile 2 and verify the close button becomes visible
1547 var x = 0;
1552 var x = 0;
1548 var y = shell.height * .5;
1553 var y = shell.height * .5;
1549 mouseMove(shell, x, y)
1554 mouseMove(shell, x, y)
1550− while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1555+ while (spreadRepeater.highlightedIndex !== 2 && x <= 4000) {
1552 mouseMove(shell, x, y)
1557 mouseMove(shell, x, y)
1553 wait(0); // spin the loop so bindings get evaluated
1558 wait(0); // spin the loop so bindings get evaluated
@@ -1594,7 +1599,7 @@ Rectangle {
1594 var x = 0;
1599 var x = 0;
1595 var y = shell.height * (data.tileInfo ? .95 : 0.5)
1600 var y = shell.height * (data.tileInfo ? .95 : 0.5)
1596 mouseMove(shell, x, y)
1601 mouseMove(shell, x, y)
1597− while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1602+ while (spreadRepeater.highlightedIndex !== 2 && x <= 4000) {
1599 mouseMove(shell, x, y)
1604 mouseMove(shell, x, y)
1600 wait(0); // spin the loop so bindings get evaluated
1605 wait(0); // spin the loop so bindings get evaluated