import android.text.Editable;
import android.text.Selection;
import android.view.MotionEvent;
+import android.view.ViewGroup;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.UrlUtils;
-import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.RenderCoordinates;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.DOMUtils;
-import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content.browser.test.util.TestInputMethodManagerWrapper;
import org.chromium.content.browser.test.util.TestTouchUtils;
import org.chromium.content.browser.test.util.TouchCommon;
private void dragHandleTo(final HandleView handle, final int dragToX, final int dragToY,
final int steps) throws Throwable {
- ContentView view = getContentView();
assertTrue(ThreadUtils.runOnUiThreadBlocking(new Callable<Boolean>() {
@Override
public Boolean call() {
int realDragToX = dragToX + (realX - adjustedX);
int realDragToY = dragToY + (realY - adjustedY);
- ContentView view = getContentView();
+ ViewGroup view = getContentViewCore().getContainerView();
int[] fromLocation = TestTouchUtils.getAbsoluteLocationFromRelative(
view, realX, realY);
int[] toLocation = TestTouchUtils.getAbsoluteLocationFromRelative(
}
private Rect getNodeBoundsPix(String nodeId) throws Throwable {
- Rect nodeBounds = DOMUtils.getNodeBounds(getContentView(),
- new TestCallbackHelperContainer(getContentView()), nodeId);
+ Rect nodeBounds = DOMUtils.getNodeBounds(getContentViewCore(), nodeId);
- RenderCoordinates renderCoordinates = getContentView().getRenderCoordinates();
- int offsetX = getContentView().getContentViewCore().getViewportSizeOffsetWidthPix();
- int offsetY = getContentView().getContentViewCore().getViewportSizeOffsetHeightPix();
+ RenderCoordinates renderCoordinates = getContentViewCore().getRenderCoordinates();
+ int offsetX = getContentViewCore().getViewportSizeOffsetWidthPix();
+ int offsetY = getContentViewCore().getViewportSizeOffsetHeightPix();
int left = (int) renderCoordinates.fromLocalCssToPix(nodeBounds.left) + offsetX;
int right = (int) renderCoordinates.fromLocalCssToPix(nodeBounds.right) + offsetX;
TouchCommon touchCommon = new TouchCommon(this);
int centerX = nodeWindowBounds.centerX();
int centerY = nodeWindowBounds.centerY();
- touchCommon.longPressView(getContentView(), centerX, centerY);
+ touchCommon.longPressView(getContentViewCore().getContainerView(), centerX, centerY);
assertWaitForHandlesShowingEquals(true);
assertWaitForHandleViewStopped(getStartHandle());
private void clickToDismissHandles() throws Throwable {
TestTouchUtils.sleepForDoubleTapTimeout(getInstrumentation());
- new TouchCommon(this).singleClickView(getContentView(), 0, 0);
+ new TouchCommon(this).singleClickView(getContentViewCore().getContainerView(), 0, 0);
assertWaitForHandlesShowingEquals(false);
}