Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1759)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java

Issue 2525603003: WIP (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
index dc513fcc15017d9fd3d3c076902ff52409260769..93781416b7ff1347870422d6a1e370761111a1aa 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
@@ -880,4 +880,38 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
}
});
}
+
+ @SmallTest
+ @Feature("AndroidWebView")
+ public void testScrollOffsetAfterNewDataUrlNavigation() throws Throwable {
+ final TestAwContentsClient contentsClient = new TestAwContentsClient();
+ final ScrollTestContainerView testContainerView =
+ (ScrollTestContainerView) createAwTestContainerViewOnMainSync(contentsClient);
+ enableJavaScriptOnUiThread(testContainerView.getAwContents());
+
+ // Load a Data URL page, and check the initial scroll position.
+ StringBuilder extraContent1 = new StringBuilder();
+ for (int i = 0; i < 10; ++i) {
+ extraContent1.append(i);
+ extraContent1.append("<br><br><br><br><br><br><br><br><br><br>");
+ }
+ loadTestPageAndWaitForFirstFrame(
+ testContainerView, contentsClient, null, extraContent1.toString());
+ assertScrollOnMainSync(testContainerView, 0, 0);
+
+ // Scroll down.
+ final int targetScrollYPix = 10;
+ scrollToOnMainSync(testContainerView, 0, targetScrollYPix);
+ assertScrollOnMainSync(testContainerView, 0, targetScrollYPix);
+
+ // Load another Data URL page, and check if the scroll position is reset correctly.
+ StringBuilder extraContent2 = new StringBuilder();
+ for (int i = 10; i < 20; ++i) {
+ extraContent2.append(i);
+ extraContent2.append("<br><br><br><br><br><br><br><br><br><br>");
+ }
+ loadTestPageAndWaitForFirstFrame(
+ testContainerView, contentsClient, null, extraContent2.toString());
+ assertScrollOnMainSync(testContainerView, 0, 0);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698