@Override public void closeAllPlaces() { closeAllPlaces(false); }
@Override public void forceCloseAllPlaces() { closeAllPlaces(true); }
@Test public void testClosingAllPlacesIncludesCustomPanelsInsideHTMLElements() throws Exception { HTMLElement any = any(HTMLElement.class); CustomPanelDefinitionImpl customPanelDef = new CustomPanelDefinitionImpl( UnanchoredStaticWorkbenchPanelPresenter.class.getName(), any); when(panelManager.addCustomPanel(any, eq(UnanchoredStaticWorkbenchPanelPresenter.class.getName()))) .thenReturn(customPanelDef); PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city"); createWorkbenchScreenActivity(emeraldCityPlace); HTMLElement customContainer = mock(HTMLElement.class); placeManager.goTo(emeraldCityPlace, customContainer); placeManager.closeAllPlaces(); assertTrue(customPanelDef.getParts().isEmpty()); verify(panelManager).removeWorkbenchPanel(customPanelDef); }
@Test public void testClosingAllPlacesIncludesCustomPanels() throws Exception { HasWidgets any = any(HasWidgets.class); CustomPanelDefinitionImpl customPanelDef = new CustomPanelDefinitionImpl( UnanchoredStaticWorkbenchPanelPresenter.class.getName(), any); when(panelManager.addCustomPanel(any, eq(UnanchoredStaticWorkbenchPanelPresenter.class.getName()))) .thenReturn(customPanelDef); PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city"); createWorkbenchScreenActivity(emeraldCityPlace); HasWidgets customContainer = mock(HasWidgets.class); placeManager.goTo(emeraldCityPlace, customContainer); placeManager.closeAllPlaces(); assertTrue(customPanelDef.getParts().isEmpty()); verify(panelManager).removeWorkbenchPanel(customPanelDef); }
@Test public void testClosingAllPlacesIncludesCustomPanels() throws Exception { HasWidgets any = any(HasWidgets.class); CustomPanelDefinitionImpl customPanelDef = new CustomPanelDefinitionImpl( UnanchoredStaticWorkbenchPanelPresenter.class.getName(), any); when(panelManager.addCustomPanel(any, eq(UnanchoredStaticWorkbenchPanelPresenter.class.getName()))) .thenReturn(customPanelDef); PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city"); createWorkbenchScreenActivity(emeraldCityPlace); HasWidgets customContainer = mock(HasWidgets.class); placeManager.goTo(emeraldCityPlace, customContainer); placeManager.closeAllPlaces(); assertTrue(customPanelDef.getParts().isEmpty()); verify(panelManager).removeWorkbenchPanel(customPanelDef); }
@Test public void testClosingAllPlacesIncludesCustomPanelsInsideHTMLElements() throws Exception { HTMLElement any = any(HTMLElement.class); CustomPanelDefinitionImpl customPanelDef = new CustomPanelDefinitionImpl( UnanchoredStaticWorkbenchPanelPresenter.class.getName(), any); when(panelManager.addCustomPanel(any, eq(UnanchoredStaticWorkbenchPanelPresenter.class.getName()))) .thenReturn(customPanelDef); PlaceRequest emeraldCityPlace = new DefaultPlaceRequest("emerald_city"); createWorkbenchScreenActivity(emeraldCityPlace); HTMLElement customContainer = mock(HTMLElement.class); placeManager.goTo(emeraldCityPlace, customContainer); placeManager.closeAllPlaces(); assertTrue(customPanelDef.getParts().isEmpty()); verify(panelManager).removeWorkbenchPanel(customPanelDef); }