Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / public / android / javatests / src / org / chromium / content / browser / input / InsertionHandleTest.java
index 7cdbd89..e6d07b9 100644 (file)
@@ -12,16 +12,15 @@ import android.test.suitebuilder.annotation.MediumTest;
 import android.text.Editable;
 import android.text.Selection;
 import android.view.KeyEvent;
+import android.view.View;
 
 import org.chromium.base.test.util.DisabledTest;
 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;
@@ -204,7 +203,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
 
         // The input box does not go to the edge of the screen, and neither should the insertion
         // handle.
-        dragToX = getContentView().getWidth();
+        dragToX = getContentViewCore().getContainerView().getWidth();
         dragHandleTo(dragToX, dragToY);
         assertTrue(handle.getPositionX() < dragToX - 100);
     }
@@ -221,19 +220,18 @@ public class InsertionHandleTest extends ContentShellTestBase {
         // click (only if it changes the selection), the insertion handle is displayed. So that the
         // second click changes the selection, the two clicks should be in sufficiently different
         // locations.
-        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();
         float left = renderCoordinates.fromLocalCssToPix(nodeBounds.left) + offsetX;
         float right = renderCoordinates.fromLocalCssToPix(nodeBounds.right) + offsetX;
         float top = renderCoordinates.fromLocalCssToPix(nodeBounds.top) + offsetY;
         float bottom = renderCoordinates.fromLocalCssToPix(nodeBounds.bottom) + offsetY;
 
         TouchCommon touchCommon = new TouchCommon(this);
-        touchCommon.singleClickView(getContentView(),
+        touchCommon.singleClickView(getContentViewCore().getContainerView(),
                 (int)(left + 3 * (right - left) / 4), (int)(top + (bottom - top) / 2));
 
 
@@ -241,7 +239,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
         assertTrue(waitForHasSelectionPosition());
 
         // TODO(cjhopman): Wait for keyboard display finished?
-        touchCommon.singleClickView(getContentView(),
+        touchCommon.singleClickView(getContentViewCore().getContainerView(),
                 (int)(left + (right - left) / 4), (int)(top + (bottom - top) / 2));
         assertTrue(waitForHandleShowingEquals(true));
         assertTrue(waitForHandleViewStopped());
@@ -295,7 +293,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
         HandleView handle = ihc.getHandleViewForTest();
         int initialX = handle.getPositionX();
         int initialY = handle.getPositionY();
-        ContentView view = getContentView();
+        View view = getContentViewCore().getContainerView();
 
         int fromLocation[] = TestTouchUtils.getAbsoluteLocationFromRelative(view, initialX,
                 initialY + VERTICAL_OFFSET);