Skip to content

Commit d8aaa2f

Browse files
committed
[Win32] Remove WebView environment initialization in Edge browser tests
The browser tests contain a setup method that creates and directly disposes a browser before the first test method when running on Windows. It was supposed to trigger the Edge environment setup performed when creating the Edge browser instance. This was originally introduced for testing purposes because of tests sometimes running into timeouts. On the contrary, it has a side effect on the first test to be executed, as there is no proper cleanup like after all other tests is performed after this initial setup method, e.g., the event loop is not spinned to process pending events. This change removes that additional setup/preparation logic. Instead, it reinitializes the display to establish an isolated, clean state, independent from previously executed tests in the same JVM.
1 parent bd1cdd6 commit d8aaa2f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,17 @@ public Test_org_eclipse_swt_browser_Browser(int swtBrowserSettings) {
159159
}
160160

161161
@BeforeClass
162-
public static void setupEdgeEnvironment() {
162+
public static void setupEnvironment() {
163+
// Reinitialize the display to start with a clean state
164+
Display.getCurrent().dispose();
165+
processUiEvents();
166+
Display.getDefault();
163167
// initialize Edge environment before any test runs to isolate environment setup
164168
if (SwtTestUtil.isWindows) {
165169
Shell shell = new Shell();
166-
new Browser(shell, SWT.EDGE);
170+
new Browser(shell, SWT.EDGE).getUrl();
167171
shell.dispose();
172+
processUiEvents();
168173
}
169174
}
170175

0 commit comments

Comments
 (0)