File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/tests/win32 Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments