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
private Save prompt(Save[] candidates, MPart partToTest, MPart part) {
		return partToTest == part ? candidates[0] : candidates[1];
	}
	private void testSaveAll(final Save[] returnValues, boolean confirm,
			boolean[] beforeDirty, boolean[] afterDirty, boolean success,
			boolean[] saveCalled, boolean[] throwException) {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		final MPart saveablePart = createSaveablePart(window, beforeDirty[0]);
		final MPart saveablePart2 = createSaveablePart(window, beforeDirty[1]);
		
		initialize(applicationContext, application);
		getEngine().createGui(window);
		ClientEditor editor = (ClientEditor) saveablePart.getObject();
		editor.setThrowException(throwException[0]);
		ClientEditor editor2 = (ClientEditor) saveablePart2.getObject();
		editor2.setThrowException(throwException[1]);
		window.getContext().set(ISaveHandler.class.getName(),
				new ISaveHandler() {
					public Save[] promptToSave(Collection<MPart> saveableParts) {
						int index = 0;
						Save[] prompt = new Save[saveableParts.size()];
						Iterator<MPart> it = saveableParts.iterator();
						while (it.hasNext()) {
							prompt[index] = prompt(returnValues, it.next(),
									saveablePart);
							index++;
						}