@@ -39,10 +39,12 @@ Rectangle {
39 id: surfaceContainerComponent
39 id: surfaceContainerComponent
41 SurfaceContainer {
41 SurfaceContainer {
43 anchors.fill: parent
42 anchors.fill: parent
44 focus: true
43 focus: true
45 interactive: interactiveCheckbox.checked
44 interactive: interactiveCheckbox.checked
45+ Component.onDestruction: {
46+ surfaceContainerLoader.itemDestroyed = true;
@@ -56,6 +58,7 @@ Rectangle {
56 left: parent.left
58 left: parent.left
58 width: units.gu(40)
60 width: units.gu(40)
61+ property bool itemDestroyed: false
59 sourceComponent: surfaceContainerComponent
62 sourceComponent: surfaceContainerComponent
@@ -102,7 +105,7 @@ Rectangle {
102 application.setState(ApplicationInfoInterface.Starting);
105 application.setState(ApplicationInfoInterface.Starting);
104 surfaceContainerLoader.item.surface = SurfaceManager.createSurface("foo",
107 surfaceContainerLoader.item.surface = SurfaceManager.createSurface("foo",
105− Mir.NormalType, Mir.MaximizedState, application);
108+ Mir.NormalType, Mir.MaximizedState, application.screenshot);
107 application.setState(ApplicationInfoInterface.Running);
110 application.setState(ApplicationInfoInterface.Running);
@@ -143,18 +146,27 @@ Rectangle {
144 UT.UnityTestCase {
147 UT.UnityTestCase {
145 id: testCase
148 id: testCase
146− name: "SessionContainer"
149+ name: "SurfaceContainer"
148 property Item surfaceContainer: surfaceContainerLoader.status === Loader.Ready ? surfaceContainerLoader.item : null
151 property Item surfaceContainer: surfaceContainerLoader.status === Loader.Ready ? surfaceContainerLoader.item : null
150 function cleanup() {
153 function cleanup() {
151 // reload our test subject to get it in a fresh state once again
154 // reload our test subject to get it in a fresh state once again
156+ surfaceContainerLoader.itemDestroyed = false;
152 surfaceContainerLoader.active = false;
157 surfaceContainerLoader.active = false;
159+ tryCompare(surfaceContainerLoader, "status", Loader.Null);
160+ tryCompare(surfaceContainerLoader, "item", null);
161+ tryCompare(surfaceContainerLoader, "itemDestroyed", true);
153 surfaceCheckbox.checked = false;
165 surfaceCheckbox.checked = false;
154 interactiveCheckbox.checked = true;
166 interactiveCheckbox.checked = true;
155− surfaceContainerLoader.active = true;
168+ surfaceContainerLoader.active = true;
157− tryCompare(surfaceContainerLoader.item, "surface", null);
169+ tryCompare(surfaceContainerLoader, "status", Loader.Ready);
160 when: windowShown
172 when: windowShown