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
perspective.getWindows().add(detachedWindow);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		detachedWindow.getChildren().add(partB);
		detachedWindow.setSelectedElement(partB);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partA);
		assertEquals(partA, partService.getActivePart());
		partService.activate(partB);
		assertEquals(partB, partService.getActivePart());
	}
	public void testActivate_Bug326300() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		windowA.getChildren().add(partA);
		windowA.setSelectedElement(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		windowA.getChildren().add(partB);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		windowB.getChildren().add(partC);
		windowB.setSelectedElement(partC);
		initialize(applicationContext, application);
		getEngine().createGui(windowA);