Skip to content

Commit 7246610

Browse files
committed
Adapt Test_org_eclipse_swt_events_KeyEvent for Windows Server 2025
This is WiP to analyze the issue with the Test_org_eclipse_swt_events_KeyEvent tests on Windows Server 2025
1 parent a479377 commit 7246610

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ protected void ensureShellFocused() {
360360
// Note that `Shell.isFocusControl()` still returns `true` even if a
361361
// different app is focused
362362
if (shell.handle != OS.GetForegroundWindow()) {
363+
System.out.println("handle of current shell: " + OS.GetForegroundWindow());
364+
System.out.println("handle of tracked shell: " + shell.handle);
365+
for (Shell shell : display.getShells()) {
366+
System.out.println(shell.handle + ": " + shell.toString());
367+
}
363368
fail("Test Shell lost focus (did you use keyboard/mouse while the test was running?)");
364369
}
365370
}
@@ -587,6 +592,7 @@ protected void testKey(String testName, Runnable runnable, int expectStateMask,
587592
}
588593

589594
protected void testScanCode(int pressStateMask, UsScan pressScanCode, int expectStateMask, char expectChar, int expectLocation, int expectKeyCode) {
595+
shell.forceFocus();
590596
String testName = getKeyName(pressStateMask, pressScanCode);
591597
testKey(
592598
testName,

0 commit comments

Comments
 (0)