Skip to content

Commit 49f434d

Browse files
committed
Execute browser tests for Edge #671
Browser tests were only executed for the default configuration of a system's browser using the SWT.NONE flag. Other configurations, such as using the Edge browser in Windows, were not tested. A parameterization has been added to allow other configurations to be tested. This change adds Edge to the test configurations executed for the browser. This allows to detect regressions when performing future changes to the Edge browser. Fixes #671
1 parent a588c9a commit 49f434d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
import org.eclipse.swt.widgets.Display;
7979
import org.eclipse.swt.widgets.Shell;
8080
import org.junit.Before;
81+
import org.junit.BeforeClass;
8182
import org.junit.FixMethodOrder;
8283
import org.junit.Rule;
8384
import org.junit.Test;
@@ -145,7 +146,7 @@ public static Collection<Object[]> browserFlagsToTest() {
145146
if (SwtTestUtil.isWindows) {
146147
// NOTE: This is currently disabled due to test issues in the CI
147148
// Execute Edge tests first, because IE starts some OS timer that conflicts with Edge event handling
148-
// browserFlags.add(0, new Object[] {SWT.EDGE});
149+
browserFlags.add(0, new Object[] {SWT.EDGE});
149150
}
150151
browserFlags.add(new Object[] {SWT.NONE});
151152
return browserFlags;
@@ -155,6 +156,16 @@ public Test_org_eclipse_swt_browser_Browser(int swtBrowserSettings) {
155156
this.swtBrowserSettings = swtBrowserSettings;
156157
}
157158

159+
@BeforeClass
160+
public static void setupEdgeEnvironment() {
161+
// initialize Edge environment before any test runs to isolate environment setup
162+
if (SwtTestUtil.isWindows) {
163+
Shell shell = new Shell();
164+
new Browser(shell, SWT.EDGE);
165+
shell.dispose();
166+
}
167+
}
168+
158169
@Override
159170
@Before
160171
public void setUp() {
@@ -229,6 +240,16 @@ protected void afterDispose(Display display) {
229240
printThreadsInfo();
230241
}
231242
}
243+
// if (isEdge) {
244+
// // wait for and process pending events to properly cleanup Edge browser resources
245+
// do {
246+
// processUiEvents();
247+
// try {
248+
// Thread.sleep(100);
249+
// } catch (InterruptedException e) {
250+
// }
251+
// } while (Display.getCurrent().readAndDispatch());
252+
// }
232253
if (SwtTestUtil.isGTK) {
233254
int descriptorDiff = reportOpenedDescriptors();
234255
if(descriptorDiff > 0) {

0 commit comments

Comments
 (0)