Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / public / android / javatests / src / org / chromium / content / browser / ContentViewScrollingTest.java
index 92d3a3d..7396a97 100644 (file)
@@ -123,7 +123,7 @@ public class ContentViewScrollingTest extends ContentShellTestBase {
         runTestOnUiThread(new Runnable() {
             @Override
             public void run() {
-                getContentView().fling(SystemClock.uptimeMillis(), 0, 0, vx, vy);
+                getContentViewCore().flingForTest(SystemClock.uptimeMillis(), 0, 0, vx, vy);
             }
         });
     }
@@ -132,7 +132,7 @@ public class ContentViewScrollingTest extends ContentShellTestBase {
         runTestOnUiThread(new Runnable() {
             @Override
             public void run() {
-                getContentView().scrollTo(x, y);
+                getContentViewCore().getContainerView().scrollTo(x, y);
             }
         });
     }
@@ -197,6 +197,35 @@ public class ContentViewScrollingTest extends ContentShellTestBase {
         assertWaitForScroll(false, false);
     }
 
+
+    /**
+     * To ensure the device properly responds to bounds-exceeding scrolls, e.g., overscroll
+     * effects are properly initialized.
+     */
+    @SmallTest
+    @Feature({"Main"})
+    public void testOverScroll() throws Throwable {
+        // Overscroll lower-left.
+        scrollTo(-10000, 10000);
+        assertWaitForScroll(true, false);
+
+        // Overscroll lower-right.
+        scrollTo(10000, 10000);
+        assertWaitForScroll(false, false);
+
+        // Overscroll upper-right.
+        scrollTo(10000, -10000);
+        assertWaitForScroll(false, true);
+
+        // Overscroll top-left.
+        scrollTo(-10000, -10000);
+        assertWaitForScroll(true, true);
+
+        // Diagonal overscroll lower-right.
+        scrollTo(10000, 10000);
+        assertWaitForScroll(false, false);
+    }
+
     /**
      * To ensure the AccessibilityEvent notifications (Eg:TYPE_VIEW_SCROLLED) are being sent
      * properly on scrolling a page.