Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / public / android / javatests / src / org / chromium / content / browser / ContentViewPopupZoomerTest.java
index 6205d3b..50f70f6 100644 (file)
@@ -5,19 +5,19 @@
 package org.chromium.content.browser;
 
 import android.view.View;
+import android.view.ViewGroup;
 
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.UrlUtils;
 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_shell_apk.ContentShellTestBase;
 
 import java.util.concurrent.TimeoutException;
 
 public class ContentViewPopupZoomerTest extends ContentShellTestBase {
-    private static PopupZoomer findPopupZoomer(ContentView view) {
+    private static PopupZoomer findPopupZoomer(ViewGroup view) {
         assert view != null;
         for (int i = 0; i < view.getChildCount(); i++) {
             View child = view.getChildAt(i);
@@ -27,9 +27,9 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase {
     }
 
     private static class PopupShowingCriteria implements Criteria {
-        private final ContentView mView;
+        private final ViewGroup mView;
         private final boolean mShouldBeShown;
-        public PopupShowingCriteria(ContentView view, boolean shouldBeShown) {
+        public PopupShowingCriteria(ViewGroup view, boolean shouldBeShown) {
             mView = view;
             mShouldBeShown = shouldBeShown;
         }
@@ -42,8 +42,8 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase {
     }
 
     private static class PopupHasNonZeroDimensionsCriteria implements Criteria {
-        private final ContentView mView;
-        public PopupHasNonZeroDimensionsCriteria(ContentView view) {
+        private final ViewGroup mView;
+        public PopupHasNonZeroDimensionsCriteria(ViewGroup view) {
             mView = view;
         }
         @Override
@@ -83,16 +83,15 @@ public class ContentViewPopupZoomerTest extends ContentShellTestBase {
         launchContentShellWithUrl(generateTestUrl(100, 15, "clickme"));
         assertTrue("Page failed to load", waitForActiveShellToBeDoneLoading());
 
-        final ContentView view = getActivity().getActiveContentView();
-        final TestCallbackHelperContainer viewClient =
-                new TestCallbackHelperContainer(view);
+        final ContentViewCore viewCore = getContentViewCore();
+        final ViewGroup view = viewCore.getContainerView();
 
         // The popup should be hidden before the click.
         assertTrue("The zoomer popup is shown after load.",
                 CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, false)));
 
         // Once clicked, the popup should show up.
-        DOMUtils.clickNode(this, view, viewClient, "clickme");
+        DOMUtils.clickNode(this, viewCore, "clickme");
         assertTrue("The zoomer popup did not show up on click.",
                 CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, true)));