on xenial help sign in
Some test improvements
7c1ee04Daniel d'Andrada
tests/qmltests/Stages/RecursingChildSessionControl.qml+1−1
@@ -93,7 +93,7 @@ ColumnLayout {
93 onCheckedChanged: {
93 onCheckedChanged: {
94 if (checked) {
94 if (checked) {
95 root.session.createSurface();
95 root.session.createSurface();
96− } else if (root.session.surface) {
96+ } else if (root.session && root.session.surface) {
97 ApplicationTest.removeSurface(root.session.surface);
97 ApplicationTest.removeSurface(root.session.surface);
98 }
98 }
99 }
99 }
tests/qmltests/Stages/tst_ApplicationWindow.qml+11−12
@@ -52,20 +52,15 @@ Rectangle {
52 application: fakeApplication
52 application: fakeApplication
53 }
53 }
54 }
54 }
55− FocusScope {
55+ Loader {
56− id: appFocus
56+ id: applicationWindowLoader
57 anchors {
57 anchors {
58 top: parent.top
58 top: parent.top
59 bottom: parent.bottom
59 bottom: parent.bottom
60 left: parent.left
60 left: parent.left
61 }
61 }
62 width: units.gu(40)
62 width: units.gu(40)
63−
64− Loader {
65− id: applicationWindowLoader
66− anchors.fill: parent
67− sourceComponent: applicationWindowComponent
63+ sourceComponent: applicationWindowComponent
68− }
69 }
64 }
70
65
71 Rectangle {
66 Rectangle {
@@ -73,7 +68,7 @@ Rectangle {
73 anchors {
68 anchors {
74 top: parent.top
69 top: parent.top
75 bottom: parent.bottom
70 bottom: parent.bottom
76− left: appFocus.right
71+ left: applicationWindowLoader.right
77 right: parent.right
72 right: parent.right
78 }
73 }
79
74
@@ -384,15 +379,19 @@ Rectangle {
384 verify(stateGroup.state === "void");
379 verify(stateGroup.state === "void");
385 }
380 }
386
381
387− // should be forcing active focus when interactive changes,
388− // which will cause a FocusScope higher in the object hierarchy tp be given the focus
389 function test_forceActiveFocusFollowsInterative() {
382 function test_forceActiveFocusFollowsInterative() {
390 fakeApplication.createSession();
383 fakeApplication.createSession();
391 applicationWindowLoader.item.interactive = false;
384 applicationWindowLoader.item.interactive = false;
392 applicationWindowLoader.item.interactive = true;
385 applicationWindowLoader.item.interactive = true;
393 fakeSession.createSurface();
386 fakeSession.createSurface();
394
387
395− compare(appFocus.focus, true);
388+ compare(fakeSession.surface.activeFocus, true);
389+
390+ applicationWindowLoader.item.interactive = false;
391+ compare(fakeSession.surface.activeFocus, false);
392+
393+ applicationWindowLoader.item.interactive = true;
394+ compare(fakeSession.surface.activeFocus, true);
396 }
395 }
397 }
396 }
398}
397}