on xenial help sign in
added tests
0c54fe7Michael Zanetti
qml/Stages/DesktopStage.qml+2−1
@@ -26,7 +26,6 @@ import Ubuntu.Gestures 0.1
26
26
27Rectangle {
27Rectangle {
28 id: root
28 id: root
29−
30 anchors.fill: parent
29 anchors.fill: parent
31
30
32 // Controls to be set from outside
31 // Controls to be set from outside
@@ -313,6 +312,7 @@ Rectangle {
313
312
314 DecoratedWindow {
313 DecoratedWindow {
315 id: decoratedWindow
314 id: decoratedWindow
315+ objectName: "decoratedWindow"
316 anchors.left: appDelegate.left
316 anchors.left: appDelegate.left
317 anchors.top: appDelegate.top
317 anchors.top: appDelegate.top
318 windowWidth: appDelegate.width
318 windowWidth: appDelegate.width
@@ -402,6 +402,7 @@ Rectangle {
402
402
403 MouseArea {
403 MouseArea {
404 id: tileInfo
404 id: tileInfo
405+ objectName: "tileInfo"
405 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(5) }
406 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(5) }
406 width: units.gu(30)
407 width: units.gu(30)
407 height: titleInfoColumn.height
408 height: titleInfoColumn.height
tests/qmltests/tst_Shell.qml+47
@@ -1485,5 +1485,52 @@ Rectangle {
1485
1485
1486 keyRelease(Qt.Key_Control);
1486 keyRelease(Qt.Key_Control);
1487 }
1487 }
1488+
1489+ function test_selectFromSpreadWithMouse_data() {
1490+ return [
1491+ {tag: "click on tileInfo", tileInfo: true },
1492+ {tag: "click on surface", tileInfo: false },
1493+ ]
1494+ }
1495+
1496+ function test_selectFromSpreadWithMouse(data) {
1497+ loadDesktopShellWithApps()
1498+
1499+ var appRepeater = findInvisibleChild(shell, "appRepeater");
1500+ verify(appRepeater !== null);
1501+
1502+ keyPress(Qt.Key_Control)
1503+ keyClick(Qt.Key_Tab);
1504+
1505+ appRemovedSpy.clear();
1506+
1507+ var focusAppId = ApplicationManager.get(2).appId;
1508+ var appDelegate2 = appRepeater.itemAt(2);
1509+ var decoratedWindow = findChild(appDelegate2, "decoratedWindow");
1510+ var stage = findChild(shell, "stage");
1511+
1512+ tryCompare(stage, "state", "altTab");
1513+
1514+ // Move the mouse over tile 2 and verify the highlight becomes visible
1515+ var x = 0;
1516+ var y = shell.height * (data.tileInfo ? .5 : 0.95)
1517+ mouseMove(shell, x, y)
1518+ while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1519+ print("y is", y)
1520+ x+=10;
1521+ mouseMove(shell, x, y)
1522+ waitForRendering(shell)
1523+ }
1524+ tryCompare(decoratedWindow, "highlightShown", true);
1525+
1526+ // Click the tile
1527+ mouseClick(decoratedWindow, decoratedWindow.width / 2, decoratedWindow.height / 2)
1528+
1529+ // Verify that we left the spread and app2 is the focused one now
1530+ tryCompare(stage, "state", "");
1531+ tryCompare(ApplicationManager, "focusedApplicationId", focusAppId);
1532+
1533+ keyRelease(Qt.Key_Control);
1534+ }
1488 }
1535 }
1489}
1536}