| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.test.suitebuilder.annotation.MediumTest; | |
| 8 import android.view.View; | 7 import android.view.View; |
| 9 | 8 |
| 10 import org.chromium.base.test.util.DisabledTest; | 9 import org.chromium.base.test.util.DisabledTest; |
| 11 import org.chromium.base.test.util.Feature; | |
| 12 import org.chromium.base.test.util.UrlUtils; | 10 import org.chromium.base.test.util.UrlUtils; |
| 13 import org.chromium.content.browser.test.util.Criteria; | 11 import org.chromium.content.browser.test.util.Criteria; |
| 14 import org.chromium.content.browser.test.util.CriteriaHelper; | 12 import org.chromium.content.browser.test.util.CriteriaHelper; |
| 15 import org.chromium.content.browser.test.util.DOMUtils; | 13 import org.chromium.content.browser.test.util.DOMUtils; |
| 16 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; | 14 import org.chromium.content.browser.test.util.TestCallbackHelperContainer; |
| 17 import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnPage
FinishedHelper; | |
| 18 import org.chromium.content_shell_apk.ContentShellTestBase; | 15 import org.chromium.content_shell_apk.ContentShellTestBase; |
| 19 | 16 |
| 20 import java.util.concurrent.TimeUnit; | |
| 21 import java.util.concurrent.TimeoutException; | 17 import java.util.concurrent.TimeoutException; |
| 22 | 18 |
| 23 public class ContentViewPopupZoomerTest extends ContentShellTestBase { | 19 public class ContentViewPopupZoomerTest extends ContentShellTestBase { |
| 24 private static PopupZoomer findPopupZoomer(ContentView view) { | 20 private static PopupZoomer findPopupZoomer(ContentView view) { |
| 25 assert view != null; | 21 assert view != null; |
| 26 for (int i = 0; i < view.getChildCount(); i++) { | 22 for (int i = 0; i < view.getChildCount(); i++) { |
| 27 View child = view.getChildAt(i); | 23 View child = view.getChildAt(i); |
| 28 if (child instanceof PopupZoomer) return (PopupZoomer) child; | 24 if (child instanceof PopupZoomer) return (PopupZoomer) child; |
| 29 } | 25 } |
| 30 return null; | 26 return null; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Once clicked, the popup should show up. | 94 // Once clicked, the popup should show up. |
| 99 DOMUtils.clickNode(this, view, viewClient, "clickme"); | 95 DOMUtils.clickNode(this, view, viewClient, "clickme"); |
| 100 assertTrue("The zoomer popup did not show up on click.", | 96 assertTrue("The zoomer popup did not show up on click.", |
| 101 CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, tr
ue))); | 97 CriteriaHelper.pollForCriteria(new PopupShowingCriteria(view, tr
ue))); |
| 102 | 98 |
| 103 // The shown popup should have valid dimensions eventually. | 99 // The shown popup should have valid dimensions eventually. |
| 104 assertTrue("The zoomer popup has zero dimensions.", | 100 assertTrue("The zoomer popup has zero dimensions.", |
| 105 CriteriaHelper.pollForCriteria(new PopupHasNonZeroDimensionsCrit
eria(view))); | 101 CriteriaHelper.pollForCriteria(new PopupHasNonZeroDimensionsCrit
eria(view))); |
| 106 } | 102 } |
| 107 } | 103 } |
| OLD | NEW |