Skip to content

Commit f20a184

Browse files
committed
More debugging code
1 parent e15fa00 commit f20a184

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

maven/core-unittests/src/test/java/com/codename1/ui/AutoCompleteTextComponentTest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.codename1.junit.FormTest;
44
import com.codename1.junit.UITestBase;
5+
import com.codename1.testing.TestUtils;
56
import com.codename1.ui.geom.Dimension;
67
import com.codename1.ui.list.DefaultListModel;
78
import com.codename1.ui.list.ListCellRenderer;
@@ -235,7 +236,18 @@ public boolean filter(String text) {
235236
int selectY = popupList.getAbsoluteY() + Math.max(1, Math.min(cellSize.getHeight(), popupList.getHeight()) / 2);
236237
implementation.dispatchPointerPressAndRelease(selectX, selectY);
237238

238-
waitFor(latch, 400);
239+
assertTrue(form == CN.getCurrentForm());
240+
//waitFor(latch, 400);
241+
int timeout = 400;
242+
while(latch.getCount() > 0) {
243+
assertTrue(timeout > 0, "Failed when cellSize: " + cellSize +
244+
" selectX: " + selectX + " selectY: " + selectY +
245+
" popupList.getWidth(): " + popupList.getWidth() +
246+
" popupList.getHeight(): " + popupList.getHeight() +
247+
" componentAt: " + form.getComponentAt(selectX, selectY));
248+
TestUtils.waitFor(5);
249+
timeout -= 5;
250+
}
239251

240252
assertEquals("Red", field.getText());
241253
assertEquals("Red", component.getText());

0 commit comments

Comments
 (0)