Skip to content

Commit 03fa489

Browse files
committed
Adapt Test_org_eclipse_swt_events_KeyEvent for Windows Server 2025 #2516
This is WiP to analyze the issue with the Test_org_eclipse_swt_events_KeyEvent tests on Windows Server 2025.
1 parent 35119f0 commit 03fa489

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/tests/win32/KeyboardLayoutTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public void setUp(TestInfo testInfo) {
249249

250250
shell.setSize(100, 100);
251251
shell.open();
252+
shell.forceActive();
252253
shell.forceFocus();
253254
}
254255

@@ -360,6 +361,11 @@ protected void ensureShellFocused() {
360361
// Note that `Shell.isFocusControl()` still returns `true` even if a
361362
// different app is focused
362363
if (shell.handle != OS.GetForegroundWindow()) {
364+
System.out.println("handle of current shell: " + OS.GetForegroundWindow());
365+
System.out.println("handle of tracked shell: " + shell.handle);
366+
for (Shell shell : display.getShells()) {
367+
System.out.println(shell.handle + ": " + shell.toString());
368+
}
363369
fail("Test Shell lost focus (did you use keyboard/mouse while the test was running?)");
364370
}
365371
}
@@ -501,6 +507,7 @@ protected void onKeyError(AssertionError error) {
501507
}
502508

503509
protected void expectKeyEvents(String testName, Runnable runnable, Event... expectEvents) {
510+
shell.forceActive();
504511
events.clear();
505512
runnable.run();
506513

0 commit comments

Comments
 (0)