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
partStackA.getChildren().add(partA2);
		MPart partB1 = BasicFactoryImpl.eINSTANCE.createPart();
		MPart partB2 = BasicFactoryImpl.eINSTANCE.createPart();
		partB1.setElementId("partB1");
		partB2.setElementId("partB2");
		partStackB.getChildren().add(partB1);
		partStackB.getChildren().add(partB2);
		partStackA.setSelectedElement(partA1);
		partStackB.setSelectedElement(partB1);
		window.setSelectedElement(partStackA);
		application.setSelectedElement(window);
		initialize(applicationContext, application);
		getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		partService.activate(partA1);
		assertEquals(partA1, partService.getActivePart());
		assertEquals(null, partA2.getContext());
		assertEquals(null, partB2.getContext());
		MPart shownPart = partService.showPart("partA2",
				EPartService.PartState.CREATE);
		assertTrue(partService.isPartVisible(partA1));
		assertTrue(partService.isPartVisible(partB1));
		assertEquals(partA1, partService.getActivePart());
		assertEquals(shownPart, partA2);
		assertNotNull(
				"The part should have been created so it should have a context",
				partA2.getContext());
		assertEquals(
				"This part has not been instantiated yet, it should have no context",