@@ -39,10 +39,12 @@ Rectangle {
3939 id: surfaceContainerComponent
4040
4141 SurfaceContainer {
42− id: surfaceContainer
4342 anchors.fill: parent
4443 focus: true
4544 interactive: interactiveCheckbox.checked
45+ Component.onDestruction: {
46+ surfaceContainerLoader.itemDestroyed = true;
47+ }
4648 }
4749 }
4850
@@ -56,6 +58,7 @@ Rectangle {
5658 left: parent.left
5759 }
5860 width: units.gu(40)
61+ property bool itemDestroyed: false
5962 sourceComponent: surfaceContainerComponent
6063 }
6164
@@ -102,7 +105,7 @@ Rectangle {
102105 application.setState(ApplicationInfoInterface.Starting);
103106
104107 surfaceContainerLoader.item.surface = SurfaceManager.createSurface("foo",
105− Mir.NormalType, Mir.MaximizedState, application);
108+ Mir.NormalType, Mir.MaximizedState, application.screenshot);
106109
107110 application.setState(ApplicationInfoInterface.Running);
108111 } else {
@@ -143,18 +146,27 @@ Rectangle {
143146
144147 UT.UnityTestCase {
145148 id: testCase
146− name: "SessionContainer"
149+ name: "SurfaceContainer"
147150
148151 property Item surfaceContainer: surfaceContainerLoader.status === Loader.Ready ? surfaceContainerLoader.item : null
149152
150153 function cleanup() {
151154 // reload our test subject to get it in a fresh state once again
155+
156+ surfaceContainerLoader.itemDestroyed = false;
152157 surfaceContainerLoader.active = false;
158+
159+ tryCompare(surfaceContainerLoader, "status", Loader.Null);
160+ tryCompare(surfaceContainerLoader, "item", null);
161+ tryCompare(surfaceContainerLoader, "itemDestroyed", true);
162+
163+ killApps();
164+
153165 surfaceCheckbox.checked = false;
154166 interactiveCheckbox.checked = true;
155− surfaceContainerLoader.active = true;
156167
157− tryCompare(surfaceContainerLoader.item, "surface", null);
168+ surfaceContainerLoader.active = true;
169+ tryCompare(surfaceContainerLoader, "status", Loader.Ready);
158170 }
159171
160172 when: windowShown