Bug 328946 Part activation history may return incorrect candidate if no placeholders could be found in a perspective
1. Window > Open Perspective > Other... > CVS Repository Exploring 2. Hide the 'CVS Repositories' view. 3. The 'History' view should become active, it is not.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
partStackA.setSelectedElement(placeholderA);
		MPlaceholder placeholderB1 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderB1.setRef(partB);
		partB.setCurSharedRef(placeholderB1);
		partStackA.getChildren().add(placeholderB1);
		MPerspective perspectiveB = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspectiveB);
		MPartStack partStackB = BasicFactoryImpl.eINSTANCE.createPartStack();
		perspectiveB.getChildren().add(partStackB);
		perspectiveB.setSelectedElement(partStackB);
		MPlaceholder placeholderC = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partC.setCurSharedRef(placeholderC);
		placeholderC.setRef(partC);
		partStackB.getChildren().add(placeholderC);
		partStackB.setSelectedElement(placeholderC);
		MPlaceholder placeholderB2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		placeholderB2.setRef(partB);
		partStackB.getChildren().add(placeholderB2);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partA);
		partService.switchPerspective(perspectiveB);
		partService.activate(partB);
		partService.switchPerspective(perspectiveA);
		assertEquals(partA, partService.getActivePart());