on xenial help sign in
Some test improvements
commit7c1ee04401e28a986037a2ea661542d353121ecb authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 10 Sep 2014, 13:06 (12 years ago) parent0f0da0f
2 files changed+12−13
tests/qmltests/Stages/RecursingChildSessionControl.qml+1−1 tests/qmltests/Stages/tst_ApplicationWindow.qml+11−12
tests/qmltests/Stages/RecursingChildSessionControl.qml+1−1
@@ -93,7 +93,7 @@ ColumnLayout {
9393 onCheckedChanged: {
9494 if (checked) {
9595 root.session.createSurface();
96− } else if (root.session.surface) {
96+ } else if (root.session && root.session.surface) {
9797 ApplicationTest.removeSurface(root.session.surface);
9898 }
9999 }
tests/qmltests/Stages/tst_ApplicationWindow.qml+11−12
@@ -52,20 +52,15 @@ Rectangle {
5252 application: fakeApplication
5353 }
5454 }
55− FocusScope {
56− id: appFocus
55+ Loader {
56+ id: applicationWindowLoader
5757 anchors {
5858 top: parent.top
5959 bottom: parent.bottom
6060 left: parent.left
6161 }
6262 width: units.gu(40)
63−
64− Loader {
65− id: applicationWindowLoader
66− anchors.fill: parent
67− sourceComponent: applicationWindowComponent
68− }
63+ sourceComponent: applicationWindowComponent
6964 }
7065
7166 Rectangle {
@@ -73,7 +68,7 @@ Rectangle {
7368 anchors {
7469 top: parent.top
7570 bottom: parent.bottom
76− left: appFocus.right
71+ left: applicationWindowLoader.right
7772 right: parent.right
7873 }
7974
@@ -384,15 +379,19 @@ Rectangle {
384379 verify(stateGroup.state === "void");
385380 }
386381
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
389382 function test_forceActiveFocusFollowsInterative() {
390383 fakeApplication.createSession();
391384 applicationWindowLoader.item.interactive = false;
392385 applicationWindowLoader.item.interactive = true;
393386 fakeSession.createSurface();
394387
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);
396395 }
397396 }
398397}