B2G/gecko/testing/marionette/marionette-listener.js
/**
 * This function creates a touch event given a touch type and a touch
 */
This function creates a touch event given a touch type and a touch
This function creates a touch event given a touch type and a touch
function emitTouchEvent(type, touch) {
  let loggingInfo = "Marionette: emitting Touch event of type " + type + " to element with id: " + touch.target.id + " and tag name: " + touch.target.tagName + " at coordinates (" + touch.clientX + ", " + touch.clientY + ") relative to the viewport";
  dump(loggingInfo);
  let domWindowUtils = curWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils);
  domWindowUtils.sendTouchEvent(type, [touch.identifier], [touch.screenX], [touch.screenY], [touch.radiusX], [touch.radiusY], [touch.rotationAngle], [touch.force], 1, 0);
}
function emitTouchEvent ( type , touch ) { let loggingInfo = "Marionette: emitting Touch event of type " + type + " to element with id: " + touch . target . id + " and tag name: " + touch . target . tagName + " at coordinates (" + touch . clientX + ", " + touch . clientY + ") relative to the viewport" ; dump ( loggingInfo ) ; let domWindowUtils = curWindow . QueryInterface ( Components . interfaces . nsIInterfaceRequestor ) . getInterface ( Components . interfaces . nsIDOMWindowUtils ) ; domWindowUtils . sendTouchEvent ( type , [ touch . identifier ] , [ touch . screenX ] , [ touch . screenY ] , [ touch . radiusX ] , [ touch . radiusY ] , [ touch . rotationAngle ] , [ touch . force ] , 1 , 0 ) ; }
This function creates a touch event given a touch type and a touch
This function creates a touch event given a touch type and a touch
/*
  Disabled per bug 888303
  marionetteLogObj.log(loggingInfo, "TRACE");
  sendSyncMessage("Marionette:shareData",
                  {log: elementManager.wrapValue(marionetteLogObj.getLogs())});
  marionetteLogObj.clearLogs();
  */