on xenial help sign in
Some fixes fot tst_Tutorial
commit07cfd620351b436d393816fa04adc0c892df0dac authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateFri 2 Dec 2016, 17:05 (10 years ago) parent4765af4
1 file changed+23−4
tests/qmltests/Tutorial/tst_Tutorial.qml+23−4
tests/qmltests/Tutorial/tst_Tutorial.qml+23−4
@@ -222,7 +222,7 @@ Rectangle {
222222 CheckBox {
223223 activeFocusOnPress: false
224224 onCheckedChanged: {
225− var surface = SurfaceManager.inputMethodSurface;
225+ var surface = topLevelSurfaceList.inputMethodSurface;
226226 if (checked) {
227227 surface.setState(Mir.RestoredState);
228228 } else {
@@ -255,6 +255,15 @@ Rectangle {
255255 property real halfWidth: shell ? shell.width / 2 : 0
256256 property real halfHeight: shell ? shell.height / 2 : 0
257257
258+ onShellChanged: {
259+ if (shell) {
260+ topLevelSurfaceList = testCase.findInvisibleChild(shell, "topLevelSurfaceList");
261+ } else {
262+ topLevelSurfaceList = null;
263+ }
264+ }
265+ property var topLevelSurfaceList: null
266+
258267 function init() {
259268 prepareShell();
260269
@@ -299,7 +308,7 @@ Rectangle {
299308 tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
300309
301310 WindowStateStorage.clear();
302− SurfaceManager.inputMethodSurface.setState(Mir.MinimizedState);
311+ //topLevelSurfaceList.inputMethodSurface.setState(Mir.MinimizedState);
303312 callManager.foregroundCall = null;
304313 AccountsService.demoEdges = false;
305314 AccountsService.demoEdgesCompleted = [];
@@ -313,6 +322,14 @@ Rectangle {
313322 prepareShell();
314323 }
315324
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+
316333 function swipeAwayGreeter() {
317334 var coverPage = findChild(shell, "coverPage");
318335 tryCompare(coverPage, "showProgress", 1);
@@ -711,7 +728,8 @@ Rectangle {
711728 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
712729 verify(tutorialLeftLoader.shown);
713730
714− var surface = SurfaceManager.inputMethodSurface;
731+ ensureInputMethodSurface();
732+ var surface = topLevelSurfaceList.inputMethodSurface;
715733 surface.setState(Mir.RestoredState);
716734
717735 var inputMethod = findInvisibleChild(shell, "inputMethod");
@@ -724,7 +742,8 @@ Rectangle {
724742 var tutorial = findChild(shell, "tutorial");
725743 verify(!tutorial.delayed);
726744
727− SurfaceManager.inputMethodSurface.setState(Mir.RestoredState);
745+ ensureInputMethodSurface();
746+ topLevelSurfaceList.inputMethodSurface.setState(Mir.RestoredState);
728747
729748 tryCompare(tutorial, "delayed", true);
730749 }