on xenial help sign in
tests for animations
commita3ae66fbdd86792c880fa70fe39d9caadd401416 authorNick Dedekind <nick.dedekind@canonical.com> dateFri 29 Aug 2014, 17:30 (12 years ago) parent552be80
2 files changed+31−5
tests/qmltests/Stages/tst_SessionContainer.qml+27 tests/qmltests/Stages/tst_SurfaceContainer.qml+4−5
tests/qmltests/Stages/tst_SessionContainer.qml+27
@@ -202,5 +202,32 @@ Rectangle {
202202 tryCompareFunction(function() { return sessionContainer.childSessions.count(); }, 0);
203203 tryCompare(sessionSpy, "count", data.depth);
204204 }
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+ }
205232 }
206233}
tests/qmltests/Stages/tst_SurfaceContainer.qml+4−5
@@ -124,16 +124,15 @@ Rectangle {
124124 compare(fakeSurface.height, surfaceContainerLoader.item.height);
125125 }
126126
127− function test_delayRelease() {
127+ function test_animateRemoval() {
128128 surfaceCheckbox.checked = true;
129129 var surfaceContainer = surfaceContainerLoader.item;
130130
131131 verify(surfaceContainer.surface !== null);
132132
133− surfaceContainer.surface.removed();
134− // should not be immediately removed
135− verify(surfaceContainer.surface !== null);
136− // but should eventually
133+ ApplicationTest.removeSurface(surfaceContainer.surface);
134+
135+ compare(surfaceContainer.state, "zombie");
137136 tryCompare(surfaceContainer, "surface", null);
138137 }
139138 }