public void testObserverIsAdded() {
IdleDetector dt = TrackingPlugin.getDefault().getIdleDetector();
tracker.setEnabled(false); // It should remove itself from the observable
int count = dt.countObservers();
tracker.setEnabled(true); // It should add itself to the observable
assertEquals(count + 1, dt.countObservers());
}
@Test
public void testWindowDeactivated() throws Exception {
IWorkbenchPage page = getActiveWindow().getActivePage();