Skip to content

Commit

Permalink
Reenable test for closing shells in WorkbenchAdvisor
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoKlare committed Sep 21, 2023
1 parent 9ac762c commit db00fe4
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand All @@ -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();
}
}
Expand All @@ -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);
Expand Down

0 comments on commit db00fe4

Please sign in to comment.