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
assertEquals(perspectiveA.getContext(), window2.getContext()
				.getActiveChild());
		EPartService partService = window2.getContext().get(EPartService.class);
		partService.switchPerspective(perspectiveB);
		assertEquals(window1.getContext(), application.getContext()
				.getActiveChild());
		assertEquals(perspectiveB.getContext(), window2.getContext()
				.getActiveChild());
	}
	/**
	 * Tests that a perspective will automatically select another part as the
	 * active part after the originally active part that's being shown across
	 * multiple perspectives has been removed.
	 */
	public void testSwitchPerspective05() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window1 = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window1);
		application.setSelectedElement(window1);
		MWindow window2 = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window2);
		MArea area = AdvancedFactoryImpl.eINSTANCE.createArea();
		window2.getSharedElements().add(area);
		MPart sharedPart = BasicFactoryImpl.eINSTANCE.createPart();
		window2.getSharedElements().add(sharedPart);
		area.getChildren().add(sharedPart);
		area.setSelectedElement(sharedPart);
		MPerspectiveStack perspectiveStack = AdvancedFactoryImpl.eINSTANCE
				.createPerspectiveStack();