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
MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		window.getChildren().add(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		window.getChildren().add(partB);
		MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		partC.setElementId("partC");
		window.getChildren().add(partC);
		window.setSelectedElement(partA);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		final IEclipseContext partContextA = partA.getContext();
		IEclipseContext partContextB = partB.getContext();
		final IEclipseContext partContextC = partC.getContext();
		final TrackingProviderPart partOneImpl = new TrackingProviderPart();
		ContextInjectionFactory.inject(partOneImpl, partContextA);
		ConsumerPart partTwoImpl = new ConsumerPart();
		ContextInjectionFactory.inject(partTwoImpl, partContextB);
		ProviderPart partThreeImpl = new ProviderPart();
		ContextInjectionFactory.inject(partThreeImpl, partContextC);
		Object selection = new Object();
		Object selection2 = new Object();
		Object selection3 = new Object();
		partOneImpl.setSelection(selection);
		partThreeImpl.setSelection(selection2);
		assertEquals(selection, partOneImpl.input);
		assertNull(partOneImpl.otherSelection);
		assertNull(partTwoImpl.input);