You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spin the event loop to process the paste operation completely.
Manually when copy and paste done on combo it works as expected. But
while calling copy and paste API on combo there is an inconsistency. It
is due to pending UI events before we check text on combo.
see #2485
Copy file name to clipboardExpand all lines: tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Combo.java
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@
34
34
importorg.eclipse.swt.graphics.Point;
35
35
importorg.eclipse.swt.graphics.Rectangle;
36
36
importorg.eclipse.swt.widgets.Combo;
37
+
importorg.eclipse.swt.widgets.Display;
37
38
importorg.junit.Before;
38
39
importorg.junit.Test;
39
40
@@ -236,6 +237,11 @@ public void test_copy() {
236
237
combo.copy();
237
238
combo.setSelection(newPoint(0,0));
238
239
combo.paste();
240
+
// Spin the event loop to let GTK process the clipboard + entry update
241
+
Displaydisplay = Display.getDefault();
242
+
while (display.readAndDispatch()) {
243
+
// loop until no more events
244
+
}
239
245
assertEquals("23123456", combo.getText());
240
246
}
241
247
@@ -501,6 +507,11 @@ public void test_paste() {
501
507
combo.cut();
502
508
assertEquals("1456", combo.getText());
503
509
combo.paste();
510
+
// Spin the event loop to let GTK process the clipboard + entry update
0 commit comments