From 553da314d8ccb3743cf850a79fd2c89245a3b015 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 74fcc658a1..612e4315a1 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 @@ -2609,8 +2609,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); @@ -2636,6 +2635,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;