From db00fe435c1ff4ec35ecb6738aed01896dfd9946 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Thu, 21 Sep 2023 08:57:58 +0200 Subject: [PATCH] Reenable test for closing shells in WorkbenchAdvisor --- .../org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java index 33314204c1f..f933d32f130 100644 --- a/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java +++ b/tests/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/WorkbenchAdvisorTest.java @@ -33,7 +33,6 @@ import org.eclipse.ui.tests.rcp.util.WorkbenchAdvisorObserver; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class WorkbenchAdvisorTest { @@ -296,10 +295,6 @@ public void preWindowOpen(IWorkbenchWindowConfigurer configurer) { assertEquals(PlatformUI.RETURN_OK, code); } -// testShellClose() is commented out because it was failing with the shells having already been disposed. -// It's unclear what this was really trying to test anyway. - - @Ignore @Test public void testShellClose() { WorkbenchAdvisorObserver wa = new WorkbenchAdvisorObserver() { @@ -310,7 +305,7 @@ public void eventLoopIdle(Display disp) { Shell[] shells = disp.getShells(); for (Shell shell : shells) { - if (shell != null) { + if (shell != null && !shell.isDisposed()) { shell.close(); } } @@ -325,6 +320,7 @@ public void eventLoopIdle(Display disp) { wa.assertNextOperation(WorkbenchAdvisorObserver.PRE_STARTUP); wa.assertNextOperation(WorkbenchAdvisorObserver.PRE_WINDOW_OPEN); wa.assertNextOperation(WorkbenchAdvisorObserver.FILL_ACTION_BARS); + wa.assertNextOperation(WorkbenchAdvisorObserver.POST_WINDOW_RESTORE); wa.assertNextOperation(WorkbenchAdvisorObserver.POST_WINDOW_OPEN); wa.assertNextOperation(WorkbenchAdvisorObserver.POST_STARTUP); wa.assertNextOperation(WorkbenchAdvisorObserver.PRE_WINDOW_SHELL_CLOSE);