FileDocCategorySizeDatePackage
CallbackProxy.javaAPI DocAndroid 1.5 API10320Wed May 06 22:42:02 BST 2009com.android.dumprendertree

CallbackProxy

public class CallbackProxy extends android.os.Handler implements EventSender, LayoutTestController

Fields Summary
private EventSender
mEventSender
private LayoutTestController
mLayoutTestController
private static final int
EVENT_DOM_LOG
private static final int
EVENT_FIRE_KBD
private static final int
EVENT_KEY_DOWN_1
private static final int
EVENT_KEY_DOWN_2
private static final int
EVENT_LEAP
private static final int
EVENT_MOUSE_CLICK
private static final int
EVENT_MOUSE_DOWN
private static final int
EVENT_MOUSE_MOVE
private static final int
EVENT_MOUSE_UP
private static final int
LAYOUT_CLEAR_LIST
private static final int
LAYOUT_DISPLAY
private static final int
LAYOUT_DUMP_TEXT
private static final int
LAYOUT_DUMP_HISTORY
private static final int
LAYOUT_DUMP_CHILD_SCROLL
private static final int
LAYOUT_DUMP_EDIT_CB
private static final int
LAYOUT_DUMP_SEL_RECT
private static final int
LAYOUT_DUMP_TITLE_CHANGES
private static final int
LAYOUT_KEEP_WEB_HISTORY
private static final int
LAYOUT_NOTIFY_DONE
private static final int
LAYOUT_QUEUE_BACK_NAV
private static final int
LAYOUT_QUEUE_FWD_NAV
private static final int
LAYOUT_QUEUE_LOAD
private static final int
LAYOUT_QUEUE_RELOAD
private static final int
LAYOUT_QUEUE_SCRIPT
private static final int
LAYOUT_REPAINT_HORZ
private static final int
LAYOUT_SET_ACCEPT_EDIT
private static final int
LAYOUT_MAIN_FIRST_RESP
private static final int
LAYOUT_SET_WINDOW_KEY
private static final int
LAYOUT_TEST_REPAINT
private static final int
LAYOUT_WAIT_UNTIL_DONE
Constructors Summary
CallbackProxy(EventSender eventSender, LayoutTestController layoutTestController)

    
      
              
        mEventSender = eventSender;
        mLayoutTestController = layoutTestController;
    
Methods Summary
public voidclearBackForwardList()

        obtainMessage(LAYOUT_CLEAR_LIST).sendToTarget();
    
public voiddisplay()

        obtainMessage(LAYOUT_DISPLAY).sendToTarget();
    
public voiddumpAsText()

        obtainMessage(LAYOUT_DUMP_TEXT).sendToTarget();
    
public voiddumpBackForwardList()

        obtainMessage(LAYOUT_DUMP_HISTORY).sendToTarget();
    
public voiddumpChildFrameScrollPositions()

        obtainMessage(LAYOUT_DUMP_CHILD_SCROLL).sendToTarget();
    
public voiddumpEditingCallbacks()

        obtainMessage(LAYOUT_DUMP_EDIT_CB).sendToTarget(); 
    
public voiddumpSelectionRect()

        obtainMessage(LAYOUT_DUMP_SEL_RECT).sendToTarget(); 
    
public voiddumpTitleChanges()

        obtainMessage(LAYOUT_DUMP_TITLE_CHANGES).sendToTarget();
    
public voidenableDOMUIEventLogging(int DOMNode)

        obtainMessage(EVENT_DOM_LOG, DOMNode, 0).sendToTarget();
    
public voidfireKeyboardEventsToElement(int DOMNode)

        obtainMessage(EVENT_FIRE_KBD, DOMNode, 0).sendToTarget();
    
public voidhandleMessage(android.os.Message msg)

        switch (msg.what) {
        case EVENT_DOM_LOG:
            mEventSender.enableDOMUIEventLogging(msg.arg1);
            break;
        case EVENT_FIRE_KBD:
            mEventSender.fireKeyboardEventsToElement(msg.arg1);
            break;
        case EVENT_KEY_DOWN_1:
            HashMap map = (HashMap) msg.obj;
            mEventSender.keyDown((String) map.get("character"), 
                    (String[]) map.get("withModifiers"));
            break;

        case EVENT_KEY_DOWN_2:
            mEventSender.keyDown((String)msg.obj);
            break;

        case EVENT_LEAP:
            mEventSender.leapForward(msg.arg1);
            break;

        case EVENT_MOUSE_CLICK:
            mEventSender.mouseClick();
            break;

        case EVENT_MOUSE_DOWN:
            mEventSender.mouseDown();
            break;

        case EVENT_MOUSE_MOVE:
            mEventSender.mouseMoveTo(msg.arg1, msg.arg2);
            break;

        case EVENT_MOUSE_UP:
            mEventSender.mouseUp();
            break;

        case LAYOUT_CLEAR_LIST:
            mLayoutTestController.clearBackForwardList();
            break;

        case LAYOUT_DISPLAY:
            mLayoutTestController.display();
            break;

        case LAYOUT_DUMP_TEXT:
            mLayoutTestController.dumpAsText();
            break;

        case LAYOUT_DUMP_HISTORY:
            mLayoutTestController.dumpBackForwardList();
            break;

        case LAYOUT_DUMP_CHILD_SCROLL:
            mLayoutTestController.dumpChildFrameScrollPositions();
            break;

        case LAYOUT_DUMP_EDIT_CB:
            mLayoutTestController.dumpEditingCallbacks();
            break;

        case LAYOUT_DUMP_SEL_RECT:
            mLayoutTestController.dumpSelectionRect();
            break;

        case LAYOUT_DUMP_TITLE_CHANGES:
            mLayoutTestController.dumpTitleChanges();
            break;

        case LAYOUT_KEEP_WEB_HISTORY:
            mLayoutTestController.keepWebHistory();
            break;

        case LAYOUT_NOTIFY_DONE:
            mLayoutTestController.notifyDone();
            break;

        case LAYOUT_QUEUE_BACK_NAV:
            mLayoutTestController.queueBackNavigation(msg.arg1);
            break;

        case LAYOUT_QUEUE_FWD_NAV:
            mLayoutTestController.queueForwardNavigation(msg.arg1);
            break;

        case LAYOUT_QUEUE_LOAD:
            HashMap<String, String> loadMap = 
                (HashMap<String, String>) msg.obj;
            mLayoutTestController.queueLoad(loadMap.get("Url"), 
                    loadMap.get("frameTarget"));
            break;

        case LAYOUT_QUEUE_RELOAD:
            mLayoutTestController.queueReload();
            break;

        case LAYOUT_QUEUE_SCRIPT:
            mLayoutTestController.queueScript((String)msg.obj);
            break;

        case LAYOUT_REPAINT_HORZ:
            mLayoutTestController.repaintSweepHorizontally();
            break;

        case LAYOUT_SET_ACCEPT_EDIT:
            mLayoutTestController.setAcceptsEditing(
                    msg.arg1 == 1 ? true : false);
            break;
        case LAYOUT_MAIN_FIRST_RESP:
            mLayoutTestController.setMainFrameIsFirstResponder(
                    msg.arg1 == 1 ? true : false);
            break;

        case LAYOUT_SET_WINDOW_KEY:
            mLayoutTestController.setWindowIsKey(
                    msg.arg1 == 1 ? true : false);
            break;

        case LAYOUT_TEST_REPAINT:
            mLayoutTestController.testRepaint();
            break;

        case LAYOUT_WAIT_UNTIL_DONE:
            mLayoutTestController.waitUntilDone();
            break;
        }
    
public voidkeepWebHistory()

        obtainMessage(LAYOUT_KEEP_WEB_HISTORY).sendToTarget();
    
public voidkeyDown(java.lang.String character, java.lang.String[] withModifiers)

        // TODO Auto-generated method stub
        HashMap map = new HashMap();
        map.put("character", character);
        map.put("withModifiers", withModifiers);
        obtainMessage(EVENT_KEY_DOWN_1, map).sendToTarget();
    
public voidkeyDown(java.lang.String character)

        obtainMessage(EVENT_KEY_DOWN_2, character).sendToTarget();
    
public voidleapForward(int milliseconds)

        obtainMessage(EVENT_LEAP, milliseconds, 0).sendToTarget(); 
    
public voidmouseClick()

        obtainMessage(EVENT_MOUSE_CLICK).sendToTarget();
    
public voidmouseDown()

        obtainMessage(EVENT_MOUSE_DOWN).sendToTarget();
    
public voidmouseMoveTo(int X, int Y)

        obtainMessage(EVENT_MOUSE_MOVE, X, Y).sendToTarget();
    
public voidmouseUp()

        obtainMessage(EVENT_MOUSE_UP).sendToTarget();
    
public voidnotifyDone()

        obtainMessage(LAYOUT_NOTIFY_DONE).sendToTarget();
    
public voidqueueBackNavigation(int howfar)

        obtainMessage(LAYOUT_QUEUE_BACK_NAV, howfar, 0).sendToTarget();
    
public voidqueueForwardNavigation(int howfar)

        obtainMessage(LAYOUT_QUEUE_FWD_NAV, howfar, 0).sendToTarget();
    
public voidqueueLoad(java.lang.String Url, java.lang.String frameTarget)

        HashMap <String, String>map = new HashMap<String, String>();
        map.put("Url", Url);
        map.put("frameTarget", frameTarget);
        obtainMessage(LAYOUT_QUEUE_LOAD, map).sendToTarget();
    
public voidqueueReload()

        obtainMessage(LAYOUT_QUEUE_RELOAD).sendToTarget();
    
public voidqueueScript(java.lang.String scriptToRunInCurrentContext)

        obtainMessage(LAYOUT_QUEUE_SCRIPT, 
                scriptToRunInCurrentContext).sendToTarget();
    
public voidrepaintSweepHorizontally()

        obtainMessage(LAYOUT_REPAINT_HORZ).sendToTarget();
    
public voidsetAcceptsEditing(boolean b)

        obtainMessage(LAYOUT_SET_ACCEPT_EDIT, b ? 1 : 0, 0).sendToTarget();
    
public voidsetMainFrameIsFirstResponder(boolean b)

        obtainMessage(LAYOUT_MAIN_FIRST_RESP, b ? 1 : 0, 0).sendToTarget();
    
public voidsetWindowIsKey(boolean b)

        obtainMessage(LAYOUT_SET_WINDOW_KEY,b ? 1 : 0, 0).sendToTarget();
    
public voidtestRepaint()

        obtainMessage(LAYOUT_TEST_REPAINT).sendToTarget(); 
    
public voidwaitUntilDone()

        obtainMessage(LAYOUT_WAIT_UNTIL_DONE).sendToTarget();