Bug 326177 EPartService's getActivePart() does not appear to work properly for an application with multiple windows
Based on the code in PartServiceCreationFunction, the EPartService implementation being returned when an application's context is queried seems to be a window-level EPartService implementation.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
window.setSelectedElement(perspectiveStack);
		MPerspective perspective = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspective);
		perspectiveStack.setSelectedElement(perspective);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		MPlaceholder placeholderA = partService
				.createSharedPart("partId", true);
		MPart partA = (MPart) placeholderA.getRef();
		partA.setCurSharedRef(placeholderA);
		perspective.getChildren().add(placeholderA);
		MPlaceholder placeholderB = partService
				.createSharedPart("partId", true);
		MPart partB = (MPart) placeholderB.getRef();
		partB.setCurSharedRef(placeholderB);
		perspective.getChildren().add(placeholderB);
		partService.hidePart(partB);
		partService.showPart(partB, PartState.ACTIVATE);
		assertEquals(2, perspective.getChildren().size());
		assertEquals(placeholderA, perspective.getChildren().get(0));
		assertEquals(placeholderB, perspective.getChildren().get(1));
	}
	public void testShowPart_Bug321755() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MPartDescriptor partDescriptor = org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicFactoryImpl.eINSTANCE
				.createPartDescriptor();
		partDescriptor.setElementId("partId");