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
.getActiveChild());
	}
	public void testSwitchPerspective03() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow windowA = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.setSelectedElement(windowA);
		MWindow windowB = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(windowB);
		MPerspectiveStack perspectiveStackB = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();
		windowB.getChildren().add(perspectiveStackB);
		windowB.setSelectedElement(perspectiveStackB);
		MPerspective perspectiveB1 = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStackB.getChildren().add(perspectiveB1);
		perspectiveStackB.setSelectedElement(perspectiveB1);
		MPart partB1 = BasicFactoryImpl.eINSTANCE.createPart();
		perspectiveB1.getChildren().add(partB1);
		perspectiveB1.setSelectedElement(partB1);
		MPerspective perspectiveB2 = AdvancedFactoryImpl.eINSTANCE
				.createPerspective();
		perspectiveStackB.getChildren().add(perspectiveB2);
		MPart partB2 = BasicFactoryImpl.eINSTANCE.createPart();
		perspectiveB2.getChildren().add(partB2);
		perspectiveB2.setSelectedElement(partB2);
		initialize(applicationContext, application);
		getEngine().createGui(windowA);
		getEngine().createGui(windowB);