|
17 | 17 | import static org.assertj.core.api.Assertions.assertThat; |
18 | 18 | import static org.eclipse.debug.tests.TestUtil.waitWhile; |
19 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 20 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
20 | 21 | import static org.junit.jupiter.api.Assertions.assertNotEquals; |
| 22 | +import static org.junit.jupiter.api.Assertions.assertNull; |
21 | 23 | import static org.junit.jupiter.api.Assertions.assertTrue; |
22 | 24 |
|
23 | 25 | import java.io.ByteArrayInputStream; |
|
66 | 68 | import org.eclipse.jface.text.IRegion; |
67 | 69 | import org.eclipse.jface.util.PropertyChangeEvent; |
68 | 70 | import org.eclipse.ui.IPerspectiveDescriptor; |
| 71 | +import org.eclipse.ui.IViewReference; |
69 | 72 | import org.eclipse.ui.IWorkbenchPage; |
70 | 73 | import org.eclipse.ui.PlatformUI; |
71 | 74 | import org.eclipse.ui.console.ConsolePlugin; |
@@ -691,15 +694,21 @@ public void testConsoleNameUpdateForVisibleAndHiddenConsoles() throws Exception |
691 | 694 | assertNotEquals(console1NameAfterReshow, console1.getName(), "Visible console should resume name updates after view is shown again"); |
692 | 695 | assertEquals(console2NameAfterReshow, console2.getName(), "Hidden console name should not update after view is restored"); |
693 | 696 |
|
| 697 | + activePage.hideView(consoleView); |
| 698 | + TestUtil.processUIEvents(1000); |
| 699 | + |
694 | 700 | console1NameAfterReshow = console1.getName(); |
695 | 701 | console2NameAfterReshow = console2.getName(); |
696 | 702 |
|
697 | | - activePage.hideView(consoleView); |
698 | | - |
699 | 703 | // Wait >1 second for update |
700 | 704 | TestUtil.processUIEvents(2000); |
701 | | - assertEquals(console1NameAfterReshow, console1.getName(), "Console name should not update when console view is minimized"); |
702 | | - assertEquals(console2NameAfterReshow, console2.getName(), "Console name should not update when console view is minimized"); |
| 705 | + |
| 706 | + IViewReference ref = activePage.findViewReference(IConsoleConstants.ID_CONSOLE_VIEW); |
| 707 | + assertNull(ref, "Console view reference should be null after hiding the view"); |
| 708 | + assertFalse(activePage.isPartVisible(consoleView), "Console view should be hidden"); |
| 709 | + |
| 710 | + assertEquals(console1NameAfterReshow, console1.getName(), "Console name should not update when console view is hidden"); |
| 711 | + assertEquals(console2NameAfterReshow, console2.getName(), "Console name should not update when console view is hidden"); |
703 | 712 |
|
704 | 713 | mockProcess1.destroy(); |
705 | 714 | mockProcess2.destroy(); |
|
0 commit comments