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.getChildren().add(partStack);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setElementId("partA");
		partStack.getChildren().add(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setElementId("partB");
		partB.setToBeRendered(false);
		partStack.getChildren().add(partB);
		partStack.setSelectedElement(partA);
		window.setSelectedElement(partStack);
		application.setSelectedElement(window);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.activate(partA);
		assertEquals(partA, partService.getActivePart());
		MPart shownPart = partService.showPart("partB",
				EPartService.PartState.VISIBLE);
		assertEquals(2, partStack.getChildren().size());
		assertEquals(
				"The part is in the same stack as the active part, so the active part should not have changed",
				partA, partService.getActivePart());
		assertNotNull("The shown part should have a context",
				partB.getContext());
		assertTrue(partService.isPartVisible(partA));
		assertFalse(partService.isPartVisible(partB));
		assertEquals(partB, shownPart);
		assertTrue(partB.isToBeRendered());
	}