on xenial help sign in
tests for animations
a3ae66fNick Dedekind
tests/qmltests/Stages/tst_SessionContainer.qml+27
@@ -202,5 +202,32 @@ Rectangle {
202 tryCompareFunction(function() { return sessionContainer.childSessions.count(); }, 0);
202 tryCompareFunction(function() { return sessionContainer.childSessions.count(); }, 0);
203 tryCompare(sessionSpy, "count", data.depth);
203 tryCompare(sessionSpy, "count", data.depth);
204 }
204 }
205+
206+ function test_childrenAdjustForParentSize() {
207+ sessionCheckbox.checked = true;
208+ var sessionContainer = sessionContainerLoader.item;
209+
210+ wait(2000);
211+
212+ var session = SessionManager.createSession(sessionContainer.session.name + "-Child0",
213+ Qt.resolvedUrl("../Dash/artwork/music-player-design.png"));
214+ session.createSurface();
215+ sessionContainer.session.addChildSession(session);
216+
217+ var delegate = findChild(sessionContainer, "childDelegate0");
218+ var childContainer = findChild(delegate, "sessionContainer");
219+
220+ tryCompareFunction(function() { return childContainer.height === sessionContainer.height; }, true);
221+ tryCompareFunction(function() { return childContainer.width === sessionContainer.width; }, true);
222+ tryCompareFunction(function() { return childContainer.x === 0; }, true);
223+ tryCompareFunction(function() { return childContainer.y === 0; }, true);
224+
225+ sessionContainer.anchors.margins = units.gu(2);
226+
227+ tryCompareFunction(function() { return childContainer.height === sessionContainer.height; }, true);
228+ tryCompareFunction(function() { return childContainer.width === sessionContainer.width; }, true);
229+ tryCompareFunction(function() { return childContainer.x === 0; }, true);
230+ tryCompareFunction(function() { return childContainer.y === 0; }, true);
231+ }
205 }
232 }
206}
233}
tests/qmltests/Stages/tst_SurfaceContainer.qml+4−5
@@ -124,16 +124,15 @@ Rectangle {
124 compare(fakeSurface.height, surfaceContainerLoader.item.height);
124 compare(fakeSurface.height, surfaceContainerLoader.item.height);
125 }
125 }
126
126
127− function test_delayRelease() {
127+ function test_animateRemoval() {
128 surfaceCheckbox.checked = true;
128 surfaceCheckbox.checked = true;
129 var surfaceContainer = surfaceContainerLoader.item;
129 var surfaceContainer = surfaceContainerLoader.item;
130
130
131 verify(surfaceContainer.surface !== null);
131 verify(surfaceContainer.surface !== null);
132
132
133− surfaceContainer.surface.removed();
133+ ApplicationTest.removeSurface(surfaceContainer.surface);
134− // should not be immediately removed
134+
135− verify(surfaceContainer.surface !== null);
135+ compare(surfaceContainer.state, "zombie");
136− // but should eventually
137 tryCompare(surfaceContainer, "surface", null);
136 tryCompare(surfaceContainer, "surface", null);
138 }
137 }
139 }
138 }