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
application.setSelectedElement(window);
		MPerspectiveStack perspectiveStack = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		window.getChildren().add(perspectiveStack);
		window.setSelectedElement(perspectiveStack);
		MPerspective perspective = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspective);
		perspectiveStack.setSelectedElement(perspective);
		MPartStack partStack = BasicFactoryImpl.eINSTANCE.createPartStack();
		partStack.getTags().add("containerTag");
		perspective.getChildren().add(partStack);
		perspective.setSelectedElement(partStack);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		MPlaceholder placeholder = partService.createSharedPart("partId", true);
		MPart sharedPart = (MPart) placeholder.getRef();
		sharedPart.setCurSharedRef(placeholder);
		partService.showPart(sharedPart, PartState.ACTIVATE);
		assertTrue(partService.isPartVisible(sharedPart));
	}
	public void testActivate_partService() {
		MApplication application = createApplication("partId", "partId2");
		MWindow window = application.getChildren().get(0);
		MPartStack partStack = (MPartStack) window.getChildren().get(0);
		partStack.setSelectedElement(partStack.getChildren().get(0));
		getEngine().createGui(window);
		MPart part1 = (MPart) partStack.getChildren().get(0);
		MPart part2 = (MPart) partStack.getChildren().get(1);