Bug 246209 [Viewers] OpenStrategy postSelection delay hinders automated testing
Build ID: I20080617-2000 Steps To Reproduce: The initializeHandler method runs the firePostSelectionEvent after the TIME=500 ms, which causes the automated tests to fail unless the thread is made to sleep for 500+ ms after each arrow key pressed, which is cumbersome. More information: Could we have the TIME member public, to set to 0 when testing? Probably that would be a good idea to have some kind of a more global flag (maybe in Display) to turn off optimizations that are hostile to event driven testing?
bundles/org.eclipse.jface/src/org/eclipse/jface/util/OpenStrategy.java
if ((method & (SINGLE_CLICK | SELECT_ON_HOVER | ARROW_KEYS_OPEN)) == 0) {
			throw new IllegalArgumentException("Invalid open mode"); 
		}
        CURRENT_METHOD = method;
    }
    /**
     * @return true if editors should be activated when opened. 
     */
    public static boolean activateOnOpen() {
        return getOpenMethod() == DOUBLE_CLICK;
    }
    /*
     * Adds all needed listener to the control in order to implement
     * single-click/double-click strategies.
     */
    private void addListener(Control c) {
        c.addListener(SWT.MouseEnter, eventHandler);
        c.addListener(SWT.MouseExit, eventHandler);
        c.addListener(SWT.MouseMove, eventHandler);
        c.addListener(SWT.MouseDown, eventHandler);
        c.addListener(SWT.MouseUp, eventHandler);
        c.addListener(SWT.KeyDown, eventHandler);
        c.addListener(SWT.Selection, eventHandler);
        c.addListener(SWT.DefaultSelection, eventHandler);
        c.addListener(SWT.Collapse, eventHandler);
        c.addListener(SWT.Expand, eventHandler);
    }
    /*
     * Fire the selection event to all selectionEventListeners
     */