Fix up WebViewTest.testFlingScroll for WebViewChromium. DO NOT MERGE

This makes the testFlingScroll test wait a bit after loading the page
(so that content size change notifications have time to propagate all
the way up to the UI thread) which is to prevent flakyness.
This also increases the size of the flingable area to work around an
unrelated overview-scale bug.

BUG:10287454
Change-Id: Ia53e5356ab86ef6668ad185fba75998d9296ed3a
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 4388f47..17ed112 100644
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -1029,11 +1029,17 @@
 
     public void testFlingScroll() throws Throwable {
         DisplayMetrics metrics = mOnUiThread.getDisplayMetrics();
-        int dimension = 2 * Math.max(metrics.widthPixels, metrics.heightPixels);
+        final int dimension = 10 * Math.max(metrics.widthPixels, metrics.heightPixels);
         String p = "<p style=\"height:" + dimension + "px;" +
                 "width:" + dimension + "px\">Test fling scroll.</p>";
         mOnUiThread.loadDataAndWaitForCompletion("<html><body>" + p
                 + "</body></html>", "text/html", null);
+        new PollingCheck() {
+            @Override
+            protected boolean check() {
+                return mOnUiThread.getContentHeight() >= dimension;
+            }
+        }.run();
         getInstrumentation().waitForIdleSync();
 
         int previousScrollX = mOnUiThread.getScrollX();