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
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, but since partB is obscured by partA, partA should be the active part",
				partA, partService.getActivePart());
		partService.hidePart(partB);
		assertEquals("partA should still be the active part", partA,
				partService.getActivePart());
		partService.switchPerspective(perspectiveA);
		assertEquals(
				"partA is in both perspectives, but since partA is obscured by partB, partB should be the active part",
				partB, partService.getActivePart());
		partService.activate(partB);
		assertEquals("partB should have been activated by activate(MPart)",
				partB, partService.getActivePart());
		partService.switchPerspective(perspectiveB);
		assertEquals(
				"partA should be the only part that's being shown in perspectiveB, thus, it should be the active part",
				partA, partService.getActivePart());
	}
	/**
	 * Test to ensure that switching perspectives doesn't cause a hidden shared
	 * part to be displayed again.
	 */
	public void testHidePart_ActivationHistory16D() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();