Bug 328339 Part activation history seems to ignore detached windows
1. Detach a view. 2. Drag another view into said detached window. 3. Activate the two views alternatively. 4. Close one of them. 5. A part in the workbench window is activated instead of the other view in the detached window.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
partService.switchPerspective(perspectiveB);
		assertEquals(sharedPart, partService.getActivePart());
		partService.hidePart(sharedPart);
		assertNull(partService.getActivePart());
		application.setSelectedElement(window1);
		window1.getContext().activate();
		partService.switchPerspective(perspectiveA);
		assertEquals(window1.getContext(), application.getContext()
				.getActiveChild());
		assertEquals(perspectiveA.getContext(), window2.getContext()
				.getActiveChild());
	}
	/**
	 * Test to ensure that the method annotated with the {@link Focus}
	 * annotation is invoked when switching between perspectives.
	 */
	public void testSwitchPerspective06() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart partA = BasicFactoryImpl.eINSTANCE.createPart();
		partA.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.application.ClientEditor");
		window.getSharedElements().add(partA);
		MPart partB = BasicFactoryImpl.eINSTANCE.createPart();
		partB.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.application.ClientEditor");
		window.getSharedElements().add(partB);
		MPerspectiveStack perspectiveStack = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();