From e4a4d28654657709a87485d0b4402a9f1040758f Mon Sep 17 00:00:00 2001 From: Sebastian Ratz Date: Fri, 13 Dec 2024 15:34:05 +0100 Subject: [PATCH] Browser Tests: Try to stabilize test_TabTraversalOutOfBrowser --- .../tests/junit/Test_org_eclipse_swt_browser_Browser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java index 34555f1e5ed..c48b6ffaa20 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java @@ -2638,8 +2638,7 @@ public void completed(ProgressEvent event) { browser2.dispose(); } -//@Test -// FIXME This test should at least work for Edge on Windows. +@Test public void test_TabTraversalOutOfBrowser() { assumeFalse("Not currently working on macOS, see https://github.com/eclipse-platform/eclipse.platform.swt/issues/1644", SwtTestUtil.isCocoa); assumeFalse("Not currently working on Linux, see https://github.com/eclipse-platform/eclipse.platform.swt/issues/1644", SwtTestUtil.isGTK); @@ -2665,6 +2664,8 @@ public void test_TabTraversalOutOfBrowser() { // send tab key via low-level event -> focus should move to Text control AtomicBoolean textGainedFocus = new AtomicBoolean(false); text.addFocusListener(FocusListener.focusGainedAdapter(e -> textGainedFocus.set(true))); + // make sure the browser's shell is active + browser.getShell().forceActive(); Event event = new Event(); event.type = SWT.KeyDown; event.keyCode = SWT.TAB;