Index: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java |
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java |
index 9abfda3c77e683d21e281410906d7aec8c261992..0ce8a7f67e3a064f36a05483877317e2e3fa0000 100644 |
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java |
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java |
@@ -185,4 +185,20 @@ public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte |
callbackHelper.waitForCallback( |
currentCallCount, 1, WAIT_PAGE_LOADING_TIMEOUT_SECONDS, TimeUnit.SECONDS); |
} |
+ |
+ // TODO(aelias): This method needs to be removed once http://crbug.com/179511 is fixed. |
+ // Meanwhile, we have to wait if the page has the <meta viewport> tag. |
+ /** |
+ * Waits till the ContentViewCore receives the expected page scale factor |
+ * from the compositor and asserts that this happens. |
+ */ |
+ protected void assertWaitForPageScaleFactorMatch(final float expectedScale) |
+ throws InterruptedException { |
+ assertTrue(CriteriaHelper.pollForCriteria(new Criteria() { |
+ @Override |
+ public boolean isSatisfied() { |
+ return getContentViewCore().getScale() == expectedScale; |
+ } |
+ })); |
+ } |
} |