on xenial help sign in
more test fixes
commit9eb2692e2de9e9662a901f1733ffabd1b2d9d17d authorNick Dedekind <nick.dedekind@canonical.com> dateWed 29 Mar 2017, 13:10 (10 years ago) parent27a262b
8 files changed+16−32
tests/mocks/Unity/Application/SurfaceManager.cpp+2−1 tests/mocks/WindowManager/MockScreens.cpp−1 tests/qmltests/Tutorial/tst_Tutorial.qml+1−11 tests/qmltests/tst_OrientedShell.qml+2−5 tests/qmltests/tst_Shell.qml+3−6 tests/qmltests/tst_ShellApplication.qml+6 tests/qmltests/tst_ShellWithPin.qml+1−7 tests/utils/modules/Unity/Test/StageTestCase.qml+1−1
tests/mocks/Unity/Application/SurfaceManager.cpp+2−1
@@ -367,6 +367,7 @@ void SurfaceManager::createInputMethodSurface()
367367 if (!m_virtualKeyboard) {
368368 m_virtualKeyboard = new VirtualKeyboard;
369369 registerSurface(m_virtualKeyboard);
370− Q_EMIT surfaceCreated(m_virtualKeyboard);
370+
371+ WindowManagementPolicy::instance()->addWindow(m_surfaceToWindow[m_virtualKeyboard].window);
371372 }
372373}
tests/mocks/WindowManager/MockScreens.cpp−1
@@ -97,7 +97,6 @@ public:
9797 }
9898
9999 QScreen* qscreen() const override {
100− qDebug() << "GET SCREEN" << qGuiApp->topLevelWindows();
101100 if (qGuiApp->topLevelWindows().count() > 0) {
102101 return qGuiApp->topLevelWindows()[0]->screen();
103102 }
tests/qmltests/Tutorial/tst_Tutorial.qml+1−11
@@ -144,10 +144,6 @@ Rectangle {
144144 Component.onDestruction: {
145145 shellLoader.itemDestroyed = true;
146146 }
147− SurfaceManager {
148− id: surfaceMan
149− }
150− surfaceManager: surfaceMan
151147 }
152148 }
153149 }
@@ -250,13 +246,7 @@ Rectangle {
250246 property real halfWidth: shell ? shell.width / 2 : 0
251247 property real halfHeight: shell ? shell.height / 2 : 0
252248
253− onShellChanged: {
254− if (shell) {
255− topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
256− } else {
257− topLevelSurfaceList = null;
258− }
259− }
249+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null;
260250
261251 function init() {
262252 prepareShell();
tests/qmltests/tst_OrientedShell.qml+2−5
@@ -449,8 +449,8 @@ Rectangle {
449449 when: windowShown
450450
451451 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
452− property Item shell
453− property QtObject topLevelSurfaceList
452+ property Item shell: null
453+ property QtObject topLevelSurfaceList : shell ? shell.topLevelSurfaceList : null
454454 property var panelState: undefined
455455
456456 onOrientedShellChanged: {
@@ -518,7 +518,6 @@ Rectangle {
518518 function cleanup() {
519519 tryCompare(shell, "waitingOnGreeter", false, 10000); // make sure greeter didn't leave us in disabled state
520520 shell = null;
521− topLevelSurfaceList = null;
522521
523522 tearDown();
524523 }
@@ -1478,8 +1477,6 @@ Rectangle {
14781477
14791478 shell = findChild(orientedShell, "shell");
14801479 verify(shell);
1481−
1482− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
14831480 verify(topLevelSurfaceList);
14841481
14851482 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
tests/qmltests/tst_Shell.qml+3−6
@@ -56,19 +56,16 @@ Rectangle {
5656 id: appMenuData
5757 }
5858
59− property var shell: shellLoader.item ? shellLoader.item : null
59+ readonly property var shell: shellLoader.item ? shellLoader.item : null
6060 onShellChanged: {
6161 if (shell) {
62− topLevelSurfaceList = shell.topLevelSurfaceList;
6362 panelState = testCase.findInvisibleChild(shell, "panelState");
6463 } else {
65− topLevelSurfaceList = null;
6664 panelState = null;
6765 }
6866 }
69−
70− property var topLevelSurfaceList: null
7167 property var panelState: null
68+ readonly property alias topLevelSurfaceList: testCase.topLevelSurfaceList
7269
7370 QtObject {
7471 id: _screenWindow
@@ -566,6 +563,7 @@ Rectangle {
566563 when: windowShown
567564
568565 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
566+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
569567
570568 function init() {
571569 if (shellLoader.active) {
@@ -604,7 +602,6 @@ Rectangle {
604602 waitForGreeterToStabilize();
605603
606604 // from StageTestCase
607− topLevelSurfaceList = shell.topLevelSurfaceList;
608605 verify(topLevelSurfaceList);
609606 stage = findChild(shell, "stage");
610607
tests/qmltests/tst_ShellApplication.qml+6
@@ -159,4 +159,10 @@ Rectangle {
159159
160160 ShellApplication {
161161 }
162+
163+ UnityTestCase {
164+ id: testCase
165+ name: "ShellApplication"
166+ when: windowShown
167+ }
162168}
tests/qmltests/tst_ShellWithPin.qml+1−7
@@ -63,10 +63,6 @@ Item {
6363 Component.onDestruction: {
6464 shellLoader.itemDestroyed = true
6565 }
66− SurfaceManager {
67− id: surfaceMan
68− }
69− surfaceManager: surfaceMan
7066 }
7167 }
7268 }
@@ -137,6 +133,7 @@ Item {
137133 when: windowShown
138134
139135 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
136+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
140137
141138 function init() {
142139 tryCompare(shell, "waitingOnGreeter", false); // will be set when greeter is all ready
@@ -153,7 +150,6 @@ Item {
153150
154151 // from StageTestCase
155152 stage = findChild(shell, "stage");
156− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
157153 verify(topLevelSurfaceList);
158154
159155 startApplication("unity8-dash");
@@ -162,8 +158,6 @@ Item {
162158 function cleanup() {
163159 tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
164160
165− topLevelSurfaceList = null;
166−
167161 shellLoader.itemDestroyed = false
168162
169163 shellLoader.active = false
tests/utils/modules/Unity/Test/StageTestCase.qml+1−1
@@ -62,7 +62,7 @@ UnityTestCase {
6262
6363 return findChild(stage, "appDelegate_" + surfaceId);
6464 } catch(err) {
65− throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed!");
65+ throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed! - " + err);
6666 }
6767 }
6868}