Skip to content

Commit 986bf02

Browse files
committed
Use form animation helpers in demo screenshot test
1 parent c8dbe29 commit 986bf02

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

docs/demos/common/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
<scope>provided</scope>
2020
</dependency>
2121

22-
<dependency>
23-
<groupId>xalan</groupId>
24-
<artifactId>serializer</artifactId>
25-
<version>2.7.2</version>
26-
</dependency>
27-
2822
<!-- INJECT DEPENDENCIES -->
2923
</dependencies>
3024

docs/demos/common/src/test/java/com/codenameone/developerguide/animations/AnimationDemosScreenshotTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void waitForFormReady(Form form) {
154154
private void waitForHost(Form host) {
155155
long deadline = System.currentTimeMillis() + FORM_TIMEOUT_MS;
156156
while (Display.getInstance().getCurrent() != host) {
157-
Display.getInstance().animate();
157+
animateCurrentForm();
158158
TestUtils.waitFor(50);
159159
if (System.currentTimeMillis() > deadline) {
160160
fail("Timed out waiting to return to host form.");
@@ -187,7 +187,7 @@ private void returnToHost(Form demoForm, Form host) {
187187
unwindForm(active, host);
188188
}
189189

190-
Display.getInstance().animate();
190+
animateCurrentForm();
191191
TestUtils.waitFor(120);
192192
}
193193

@@ -220,6 +220,13 @@ private Form currentForm() {
220220
return (current instanceof Form) ? (Form) current : null;
221221
}
222222

223+
private void animateCurrentForm() {
224+
Form current = currentForm();
225+
if (current != null) {
226+
current.animate();
227+
}
228+
}
229+
223230
private void triggerAnimationIfNeeded(Demo demo, Form form) {
224231
if (demo == null || form == null) {
225232
return;

0 commit comments

Comments
 (0)