Bug 329184 Detached view that is an activation target candidate can prevent perspective switching
1. Detach the 'Outline' view. 2. Window > Open Perspective > Debug 3. Window > Open Perspective > Java 4. The perspective switch doesn't actually happen. You see the 'Debug' perspective's content with an 'Outline' view detached. Closing the 'Outline' view in the 'Debug' perspective will workaround this problem.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
perspectiveStack.setSelectedElement(perspectiveA);
		MPlaceholder partPlaceholderB1 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partPlaceholderB1.setRef(partB);
		partB.setCurSharedRef(partPlaceholderB1);
		perspectiveA.getChildren().add(partPlaceholderB1);
		perspectiveA.setSelectedElement(partPlaceholderB1);
		MPerspective perspectiveB = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStack.getChildren().add(perspectiveB);
		MPlaceholder partPlaceholderA2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partPlaceholderA2.setRef(partA);
		perspectiveB.getChildren().add(partPlaceholderA2);
		perspectiveB.setSelectedElement(partPlaceholderA2);
		MPlaceholder partPlaceholderB2 = AdvancedFactoryImpl.eINSTANCE
				.createPlaceholder();
		partPlaceholderB2.setRef(partB);
		perspectiveB.getChildren().add(partPlaceholderB2);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = window.getContext().get(EPartService.class);
		partService.activate(partB);
		partService.switchPerspective(perspectiveB);
		assertEquals(
				"partB is in both perspectives, active part should have been preserved",
				partB, partService.getActivePart());
		partService.hidePart(partB);
		assertEquals("Hiding partB should have caused partA to be activated",
				partA, partService.getActivePart());