Skip to content

Commit 9aa7973

Browse files
committed
[Win32] Simplify cleanup after Edge test execution
When executing tests for Edge, UI events are processed on teardown of the test (or more precisely on widget disposal) as there may still be resources related to the OS WebView component being cleaned up. The current implementation was only supposed to be used for testing purposes as an attempt to address non-deterministic timeouts in tests. However, the timeouts still occur and the current implementation is prone to break as it may never terminate when new events to be process arrive frequently. This change simplifies the cleanup functionality to process UI events only once instead of looping it. This mitigates the risk of a long-running loop and reduces unnecessary complexity.
1 parent 48be417 commit 9aa7973

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,7 @@ protected void afterDispose(Display display) {
251251
}
252252
if (isEdge) {
253253
// wait for and process pending events to properly cleanup Edge browser resources
254-
do {
255-
processUiEvents();
256-
try {
257-
Thread.sleep(100);
258-
} catch (InterruptedException e) {
259-
}
260-
} while (Display.getCurrent().readAndDispatch());
254+
processUiEvents();
261255
}
262256
if (SwtTestUtil.isGTK) {
263257
int descriptorDiff = reportOpenedDescriptors();

0 commit comments

Comments
 (0)