on xenial help sign in
more test fixes
9eb2692Nick Dedekind
tests/mocks/Unity/Application/SurfaceManager.cpp+2−1
@@ -367,6 +367,7 @@ void SurfaceManager::createInputMethodSurface()
367 if (!m_virtualKeyboard) {
367 if (!m_virtualKeyboard) {
368 m_virtualKeyboard = new VirtualKeyboard;
368 m_virtualKeyboard = new VirtualKeyboard;
369 registerSurface(m_virtualKeyboard);
369 registerSurface(m_virtualKeyboard);
370− Q_EMIT surfaceCreated(m_virtualKeyboard);
370+
371+ WindowManagementPolicy::instance()->addWindow(m_surfaceToWindow[m_virtualKeyboard].window);
371 }
372 }
372}
373}
tests/mocks/WindowManager/MockScreens.cpp−1
@@ -97,7 +97,6 @@ public:
97 }
97 }
98
98
99 QScreen* qscreen() const override {
99 QScreen* qscreen() const override {
100− qDebug() << "GET SCREEN" << qGuiApp->topLevelWindows();
101 if (qGuiApp->topLevelWindows().count() > 0) {
100 if (qGuiApp->topLevelWindows().count() > 0) {
102 return qGuiApp->topLevelWindows()[0]->screen();
101 return qGuiApp->topLevelWindows()[0]->screen();
103 }
102 }
tests/qmltests/Tutorial/tst_Tutorial.qml+1−11
@@ -144,10 +144,6 @@ Rectangle {
144 Component.onDestruction: {
144 Component.onDestruction: {
145 shellLoader.itemDestroyed = true;
145 shellLoader.itemDestroyed = true;
146 }
146 }
147− SurfaceManager {
148− id: surfaceMan
149− }
150− surfaceManager: surfaceMan
151 }
147 }
152 }
148 }
153 }
149 }
@@ -250,13 +246,7 @@ Rectangle {
250 property real halfWidth: shell ? shell.width / 2 : 0
246 property real halfWidth: shell ? shell.width / 2 : 0
251 property real halfHeight: shell ? shell.height / 2 : 0
247 property real halfHeight: shell ? shell.height / 2 : 0
252
248
253− onShellChanged: {
249+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null;
254− if (shell) {
255− topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
256− } else {
257− topLevelSurfaceList = null;
258− }
259− }
260
250
261 function init() {
251 function init() {
262 prepareShell();
252 prepareShell();
tests/qmltests/tst_OrientedShell.qml+2−5
@@ -449,8 +449,8 @@ Rectangle {
449 when: windowShown
449 when: windowShown
450
450
451 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
451 property Item orientedShell: orientedShellLoader.status === Loader.Ready ? orientedShellLoader.item : null
452− property Item shell
452+ property Item shell: null
453− property QtObject topLevelSurfaceList
453+ property QtObject topLevelSurfaceList : shell ? shell.topLevelSurfaceList : null
454 property var panelState: undefined
454 property var panelState: undefined
455
455
456 onOrientedShellChanged: {
456 onOrientedShellChanged: {
@@ -518,7 +518,6 @@ Rectangle {
518 function cleanup() {
518 function cleanup() {
519 tryCompare(shell, "waitingOnGreeter", false, 10000); // make sure greeter didn't leave us in disabled state
519 tryCompare(shell, "waitingOnGreeter", false, 10000); // make sure greeter didn't leave us in disabled state
520 shell = null;
520 shell = null;
521− topLevelSurfaceList = null;
522
521
523 tearDown();
522 tearDown();
524 }
523 }
@@ -1478,8 +1477,6 @@ Rectangle {
1478
1477
1479 shell = findChild(orientedShell, "shell");
1478 shell = findChild(orientedShell, "shell");
1480 verify(shell);
1479 verify(shell);
1481−
1482− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
1483 verify(topLevelSurfaceList);
1480 verify(topLevelSurfaceList);
1484
1481
1485 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
1482 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
tests/qmltests/tst_Shell.qml+3−6
@@ -56,19 +56,16 @@ Rectangle {
56 id: appMenuData
56 id: appMenuData
57 }
57 }
58
58
59− property var shell: shellLoader.item ? shellLoader.item : null
59+ readonly property var shell: shellLoader.item ? shellLoader.item : null
60 onShellChanged: {
60 onShellChanged: {
61 if (shell) {
61 if (shell) {
62− topLevelSurfaceList = shell.topLevelSurfaceList;
63 panelState = testCase.findInvisibleChild(shell, "panelState");
62 panelState = testCase.findInvisibleChild(shell, "panelState");
64 } else {
63 } else {
65− topLevelSurfaceList = null;
66 panelState = null;
64 panelState = null;
67 }
65 }
68 }
66 }
69−
70− property var topLevelSurfaceList: null
71 property var panelState: null
67 property var panelState: null
68+ readonly property alias topLevelSurfaceList: testCase.topLevelSurfaceList
72
69
73 QtObject {
70 QtObject {
74 id: _screenWindow
71 id: _screenWindow
@@ -566,6 +563,7 @@ Rectangle {
566 when: windowShown
563 when: windowShown
567
564
568 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
565 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
566+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
569
567
570 function init() {
568 function init() {
571 if (shellLoader.active) {
569 if (shellLoader.active) {
@@ -604,7 +602,6 @@ Rectangle {
604 waitForGreeterToStabilize();
602 waitForGreeterToStabilize();
605
603
606 // from StageTestCase
604 // from StageTestCase
607− topLevelSurfaceList = shell.topLevelSurfaceList;
608 verify(topLevelSurfaceList);
605 verify(topLevelSurfaceList);
609 stage = findChild(shell, "stage");
606 stage = findChild(shell, "stage");
610
607
tests/qmltests/tst_ShellApplication.qml+6
@@ -159,4 +159,10 @@ Rectangle {
159
159
160 ShellApplication {
160 ShellApplication {
161 }
161 }
162+
163+ UnityTestCase {
164+ id: testCase
165+ name: "ShellApplication"
166+ when: windowShown
167+ }
162}
168}
tests/qmltests/tst_ShellWithPin.qml+1−7
@@ -63,10 +63,6 @@ Item {
63 Component.onDestruction: {
63 Component.onDestruction: {
64 shellLoader.itemDestroyed = true
64 shellLoader.itemDestroyed = true
65 }
65 }
66− SurfaceManager {
67− id: surfaceMan
68− }
69− surfaceManager: surfaceMan
70 }
66 }
71 }
67 }
72 }
68 }
@@ -137,6 +133,7 @@ Item {
137 when: windowShown
133 when: windowShown
138
134
139 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
135 property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
136+ topLevelSurfaceList: shell ? shell.topLevelSurfaceList : null
140
137
141 function init() {
138 function init() {
142 tryCompare(shell, "waitingOnGreeter", false); // will be set when greeter is all ready
139 tryCompare(shell, "waitingOnGreeter", false); // will be set when greeter is all ready
@@ -153,7 +150,6 @@ Item {
153
150
154 // from StageTestCase
151 // from StageTestCase
155 stage = findChild(shell, "stage");
152 stage = findChild(shell, "stage");
156− topLevelSurfaceList = findInvisibleChild(shell, "topLevelSurfaceList");
157 verify(topLevelSurfaceList);
153 verify(topLevelSurfaceList);
158
154
159 startApplication("unity8-dash");
155 startApplication("unity8-dash");
@@ -162,8 +158,6 @@ Item {
162 function cleanup() {
158 function cleanup() {
163 tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
159 tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
164
160
165− topLevelSurfaceList = null;
166−
167 shellLoader.itemDestroyed = false
161 shellLoader.itemDestroyed = false
168
162
169 shellLoader.active = false
163 shellLoader.active = false
tests/utils/modules/Unity/Test/StageTestCase.qml+1−1
@@ -62,7 +62,7 @@ UnityTestCase {
62
62
63 return findChild(stage, "appDelegate_" + surfaceId);
63 return findChild(stage, "appDelegate_" + surfaceId);
64 } catch(err) {
64 } 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);
66 }
66 }
67 }
67 }
68}
68}