KeyboardFocusManager.getCurrentKeyboardFocusManager().
addPropertyChangeListener("activeWindow", activeWindowListener);
// Check that a simple short task is correctly executed with no exception
// and doesn't create any visible dialog at screen
new ThreadedTaskController(shortTask, "Message", noExceptionHandler, preferences, viewFactory).executeTask(null);
shortTaskLatch.await(1000, TimeUnit.MILLISECONDS);
assertEquals("Simple task wasn't executed", 0, shortTaskLatch.getCount());
KeyboardFocusManager.getCurrentKeyboardFocusManager().
removePropertyChangeListener("activeWindow", activeWindowListener);
// 2. Create a longer task