1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 515307: Run test order of magnitude faster

The break inserter test was running all display events for 200ms after
each simulated keystroke, but all sideeffects were happening synchronously
or being placed on the event queue synchronously. So speed-up is achieved
by running event queue until empty instead of effectively sleeping for
200ms

Change-Id: Icffd4d5526176e596cf8ce3ac716a4ae88d51159
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
This commit is contained in:
Jonah Graham 2017-04-15 03:30:36 +01:00 committed by Gerrit Code Review @ Eclipse.org
parent 1670530ffb
commit 593dc77b6d

View file

@ -490,12 +490,8 @@ public class BracketInserterTest extends TestCase {
event.stateMask= stateMask;
fAccessor.invoke("handleKeyDown", new Object[] {event});
new DisplayHelper() {
@Override
protected boolean condition() {
return false;
}
}.waitForCondition(EditorTestHelper.getActiveDisplay(), 200);
// run event loop once until all events are handled
DisplayHelper.runEventLoop(EditorTestHelper.getActiveDisplay(), 0);
}
private int getCaret() {