Bug 341273 ESS will not work without parts
While windows without any parts probably isn't a very interesting shape, it is still possible to create such a thing. In this scenario, the ESS may not work properly because we rely solely on the active part for selection information. It should be possible to have a selection at the window level as-is.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/ESelectionServiceTest.java
assertNull(listener.getSelection());
		listener.reset();
		partService.activate(partB);
		assertNull(listener.getPart());
		assertNull(listener.getSelection());
	}
	public void testSelectionListener_Id() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setElementId("partA"); 
		window.getChildren().add(partA);
		window.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setElementId("partB"); 
		window.getChildren().add(partB);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		IEclipseContext contextA = partA.getContext();
		IEclipseContext contextB = partB.getContext();
		IEclipseContext windowContext = window.getContext();
		ESelectionService serviceA = (ESelectionService) contextA
				.get(ESelectionService.class.getName());
		ESelectionService serviceB = (ESelectionService) contextB
				.get(ESelectionService.class.getName());
		ESelectionService windowService = (ESelectionService) windowContext
				.get(ESelectionService.class.getName());