on xenial help sign in
Some fixes fot tst_Tutorial
07cfd62Daniel d'Andrada
tests/qmltests/Tutorial/tst_Tutorial.qml+23−4
@@ -222,7 +222,7 @@ Rectangle {
222 CheckBox {
222 CheckBox {
223 activeFocusOnPress: false
223 activeFocusOnPress: false
224 onCheckedChanged: {
224 onCheckedChanged: {
225− var surface = SurfaceManager.inputMethodSurface;
225+ var surface = topLevelSurfaceList.inputMethodSurface;
226 if (checked) {
226 if (checked) {
227 surface.setState(Mir.RestoredState);
227 surface.setState(Mir.RestoredState);
228 } else {
228 } else {
@@ -255,6 +255,15 @@ Rectangle {
255 property real halfWidth: shell ? shell.width / 2 : 0
255 property real halfWidth: shell ? shell.width / 2 : 0
256 property real halfHeight: shell ? shell.height / 2 : 0
256 property real halfHeight: shell ? shell.height / 2 : 0
257
257
258+ onShellChanged: {
259+ if (shell) {
260+ topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
261+ } else {
262+ topLevelSurfaceList = null;
263+ }
264+ }
265+ property var topLevelSurfaceList: null
266+
258 function init() {
267 function init() {
259 prepareShell();
268 prepareShell();
260
269
@@ -299,7 +308,7 @@ Rectangle {
299 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
308 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
300
309
301 WindowStateStorage.clear();
310 WindowStateStorage.clear();
302− SurfaceManager.inputMethodSurface.setState(Mir.MinimizedState);
311+ //topLevelSurfaceList.inputMethodSurface.setState(Mir.MinimizedState);
303 callManager.foregroundCall = null;
312 callManager.foregroundCall = null;
304 AccountsService.demoEdges = false;
313 AccountsService.demoEdges = false;
305 AccountsService.demoEdgesCompleted = [];
314 AccountsService.demoEdgesCompleted = [];
@@ -313,6 +322,14 @@ Rectangle {
313 prepareShell();
322 prepareShell();
314 }
323 }
315
324
325+ function ensureInputMethodSurface() {
326+ var surfaceManager = findInvisibleChild(shell, "surfaceManager");
327+ verify(surfaceManager);
328+ surfaceManager.createInputMethodSurface();
329+
330+ tryCompareFunction(function() { return root.topLevelSurfaceList.inputMethodSurface !== null }, true);
331+ }
332+
316 function swipeAwayGreeter() {
333 function swipeAwayGreeter() {
317 var coverPage = findChild(shell, "coverPage");
334 var coverPage = findChild(shell, "coverPage");
318 tryCompare(coverPage, "showProgress", 1);
335 tryCompare(coverPage, "showProgress", 1);
@@ -711,7 +728,8 @@ Rectangle {
711 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
728 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
712 verify(tutorialLeftLoader.shown);
729 verify(tutorialLeftLoader.shown);
713
730
731+ ensureInputMethodSurface();
714− var surface = SurfaceManager.inputMethodSurface;
732+ var surface = topLevelSurfaceList.inputMethodSurface;
715 surface.setState(Mir.RestoredState);
733 surface.setState(Mir.RestoredState);
716
734
717 var inputMethod = findInvisibleChild(shell, "inputMethod");
735 var inputMethod = findInvisibleChild(shell, "inputMethod");
@@ -724,7 +742,8 @@ Rectangle {
724 var tutorial = findChild(shell, "tutorial");
742 var tutorial = findChild(shell, "tutorial");
725 verify(!tutorial.delayed);
743 verify(!tutorial.delayed);
726
744
745+ ensureInputMethodSurface();
727− SurfaceManager.inputMethodSurface.setState(Mir.RestoredState);
746+ topLevelSurfaceList.inputMethodSurface.setState(Mir.RestoredState);
728
747
729 tryCompare(tutorial, "delayed", true);
748 tryCompare(tutorial, "delayed", true);
730 }
749 }