Bug 851861 - v2 - Intermittent testFlingCorrectness, etc al. dragSync() consumers

This commit is contained in:
Mark Capella
2015-01-21 19:23:49 -05:00
parent 2d45954134
commit 1e39e389c4
3 changed files with 32 additions and 0 deletions

View File

@@ -129,6 +129,8 @@ class JavaPanZoomController
private boolean mNegateWheelScrollY;
/* Whether the current event has been default-prevented. */
private boolean mDefaultPrevented;
/* Whether longpress events are enabled, or suppressed by robocop tests. */
private boolean isLongpressEnabled;
// Handler to be notified when overscroll occurs
private Overscroll mOverscroll;
@@ -139,6 +141,7 @@ class JavaPanZoomController
mX = new AxisX(mSubscroller);
mY = new AxisY(mSubscroller);
mTouchEventHandler = new TouchEventHandler(view.getContext(), view, this);
isLongpressEnabled = true;
checkMainThread();
@@ -1348,8 +1351,20 @@ class JavaPanZoomController
mWaitForDoubleTap = false;
}
/**
* MotionEventHelper dragAsync() robocop tests can have us suppress
* longpress events that are spuriously created on slower test devices.
*/
public void setIsLongpressEnabled(boolean isLongpressEnabled) {
this.isLongpressEnabled = isLongpressEnabled;
}
@Override
public void onLongPress(MotionEvent motionEvent) {
if (!isLongpressEnabled) {
return;
}
GeckoEvent e = GeckoEvent.createLongPressEvent(motionEvent);
GeckoAppShell.sendEventToGecko(e);
}