on xenial help sign in
fix tests
commit8666e6c5438852ce739f5c6c51c92da8249dae87 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 16 Jul 2015, 16:19 (11 years ago) parenta5ae2da
2 files changed+7−5
qml/Stages/DesktopStage.qml+3−1 tests/qmltests/tst_Shell.qml+4−4
qml/Stages/DesktopStage.qml+3−1
@@ -70,8 +70,8 @@ Rectangle {
7070 onFocusRequested: {
7171 var appIndex = priv.indexOf(appId);
7272 var appDelegate = appRepeater.itemAt(appIndex);
73− print("focus requested", appDelegate.minimized, appDelegate.maximized)
7473 appDelegate.minimized = false;
74+ appDelegate.focus = true;
7575 ApplicationManager.focusApplication(appId);
7676 }
7777 }
@@ -125,6 +125,7 @@ Rectangle {
125125
126126 FocusScope {
127127 id: appContainer
128+ objectName: "appContainer"
128129 anchors.fill: parent
129130
130131 Keys.onPressed: {
@@ -201,6 +202,7 @@ Rectangle {
201202 onFocusChanged: {
202203 if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
203204 ApplicationManager.requestFocusApplication(model.appId);
205+ decoratedWindow.forceActiveFocus();
204206 }
205207 }
206208 Component.onCompleted: {
tests/qmltests/tst_Shell.qml+4−4
@@ -806,7 +806,6 @@ Rectangle {
806806 // check that the desktop stage and window have been loaded
807807 {
808808 var desktopWindow = findChild(shell, "appWindow_webbrowser-app");
809− print("have desktopWindow", desktopWindow)
810809 verify(desktopWindow);
811810 }
812811
@@ -1317,7 +1316,6 @@ Rectangle {
13171316 waitForRendering(root)
13181317
13191318 var desktopStage = findChild(shell, "stage");
1320− print("desktopStage", desktopStage)
13211319 verify(desktopStage != null)
13221320
13231321 var app1 = ApplicationManager.startApplication("dialer-app")
@@ -1354,6 +1352,9 @@ Rectangle {
13541352 var desktopStage = findChild(shell, "stage");
13551353 verify(desktopStage !== null)
13561354
1355+ var appContainer = findInvisibleChild(shell, "appContainer")
1356+ verify(appContainer !== null)
1357+
13571358 var appRepeater = findInvisibleChild(shell, "appRepeater")
13581359 verify(appRepeater !== null)
13591360
@@ -1373,7 +1374,7 @@ Rectangle {
13731374 // We can't simulate a pressed key with keyPress() currently, so let's inject the events
13741375 // at API level. Jump for 10 times, verify that it's still at the last one and didn't wrap around.
13751376 for (var i = 0; i < 10; i++) {
1376− desktopStage.altTabNext(true);
1377+ appContainer.selectNext(true); // true == isAutoRepeat
13771378 wait(0); // Trigger the event loop to make sure all the things happen
13781379 }
13791380 tryCompare(appRepeater, "highlightedIndex", 6)
@@ -1516,7 +1517,6 @@ Rectangle {
15161517 var y = shell.height * (data.tileInfo ? .5 : 0.95)
15171518 mouseMove(shell, x, y)
15181519 while (appRepeater.highlightedIndex !== 2 && x <= 4000) {
1519− print("y is", y)
15201520 x+=10;
15211521 mouseMove(shell, x, y)
15221522 waitForRendering(shell)