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
MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setElementId("partA");
		partStackA.getChildren().add(partA);
		partStackA.setSelectedElement(partA);
		window.setSelectedElement(partStackA);
		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 partB = partService.showPart("partB",
				EPartService.PartState.VISIBLE);
		assertEquals(1, partStackA.getChildren().size());
		assertEquals(
				"Only making a part visible, the active part should not have changed",
				partA, partService.getActivePart());
		assertNotNull("The shown part should have a context",
				partB.getContext());
		assertTrue(
				"The part is the only one in the stack, it should be visible",
				partService.isPartVisible(partB));
	}
	public void testShowPart_Id_VISIBLE4() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();