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

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

Issue 694113002: Fix tests and enable virtual viewport on Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change tests to avoid horizontal scrolling Created 6 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 | android_webview/lib/main/aw_main_delegate.cc » ('j') | 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 5f8b8055297f56d19f49e2459edd0c283460b643..330d98831563447f38835fbbe9948dd641118621 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
@@ -135,7 +135,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
" margin: 0px; " +
" } " +
" div { " +
- " width:1000px; " +
+ " width:10px; " +
" height:10000px; " +
" background-color: blue; " +
" } " +
@@ -281,7 +281,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
- final int targetScrollXCss = 233;
+ final int targetScrollXCss = 0;
final int targetScrollYCss = 322;
final int targetScrollXPix = (int) Math.ceil(targetScrollXCss * deviceDIPScale);
final int targetScrollYPix = (int) Math.ceil(targetScrollYCss * deviceDIPScale);
@@ -314,7 +314,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
- final int targetScrollXCss = 132;
+ final int targetScrollXCss = 0;
final int targetScrollYCss = 243;
final int targetScrollXPix = (int) Math.floor(targetScrollXCss * deviceDIPScale);
final int targetScrollYPix = (int) Math.floor(targetScrollYCss * deviceDIPScale);
@@ -342,7 +342,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
- final int targetScrollXCss = 132;
+ final int targetScrollXCss = 0;
final int targetScrollYCss = 243;
final int targetScrollXPix = (int) Math.floor(targetScrollXCss * deviceDIPScale);
final int targetScrollYPix = (int) Math.floor(targetScrollYCss * deviceDIPScale);
@@ -372,12 +372,12 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
- final int targetScrollXCss = 132;
+ final int targetScrollXCss = 0;
final int targetScrollYCss = 243;
final int targetScrollXPix = (int) Math.floor(targetScrollXCss * deviceDIPScale);
final int targetScrollYPix = (int) Math.floor(targetScrollYCss * deviceDIPScale);
- final int maxScrollXCss = 101;
+ final int maxScrollXCss = 0;
final int maxScrollYCss = 201;
final int maxScrollXPix = (int) Math.floor(maxScrollXCss * deviceDIPScale);
final int maxScrollYPix = (int) Math.floor(maxScrollYCss * deviceDIPScale);
@@ -414,7 +414,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
final double deviceDIPScale =
DeviceDisplayInfo.create(testContainerView.getContext()).getDIPScale();
- final int maxScrollXPix = 101;
+ final int maxScrollXPix = 0;
final int maxScrollYPix = 211;
// Make sure we can't hit these values simply as a result of scrolling.
assert (maxScrollXPix % dragStepSize) != 0;
mkosiba (inactive) 2014/11/03 11:38:58 you'll need to take this out.
@@ -548,14 +548,14 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
(ScrollTestContainerView) createAwTestContainerViewOnMainSync(contentsClient);
enableJavaScriptOnUiThread(testContainerView.getAwContents());
- final int targetScrollXCss = 1000;
+ final int targetScrollXCss = 0;
final int targetScrollYCss = 10000;
final String pageHeaders =
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=0.6\"> " +
"<style type=\"text/css\"> " +
" div { " +
- " width:1000px; " +
+ " width:10px; " +
" height:10000px; " +
" background-color: blue; " +
" } " +
@@ -579,22 +579,6 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
"window.scrollTo(" + targetScrollXCss + "," + targetScrollYCss + ")");
onScrollToCallbackHelper.waitForCallback(scrollToCallCount);
- getInstrumentation().runOnMainSync(new Runnable() {
mkosiba (inactive) 2014/11/03 11:38:58 If you're removing this bit then the rest of the t
aelias_OOO_until_Jul13 2014/11/04 06:32:05 We can make a loose prediction, but I don't think
- @Override
- public void run() {
- AwContents awContents = testContainerView.getAwContents();
- int maxHorizontal = awContents.computeHorizontalScrollRange() -
- testContainerView.getWidth();
- int maxVertical = awContents.computeVerticalScrollRange() -
- testContainerView.getHeight();
- // Due to rounding going from CSS -> physical pixels it is possible that more than
- // one physical pixels corespond to one CSS pixel, which is why we can't do a
- // simple equality test here.
- assertTrue(maxHorizontal - awContents.computeHorizontalScrollOffset() < 3);
- assertTrue(maxVertical - awContents.computeVerticalScrollOffset() < 3);
- }
- });
-
scrollToCallCount = onScrollToCallbackHelper.getCallCount();
executeJavaScriptAndWaitForResult(testContainerView.getAwContents(), contentsClient,
"window.scrollTo(0, 0)");
@@ -633,7 +617,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
- testContainerView.getAwContents().flingScroll(1000, 1000);
+ testContainerView.getAwContents().flingScroll(0, 1000);
mkosiba (inactive) 2014/11/03 11:38:58 there is a CTS test identical test to this. I'll n
}
});
@@ -642,7 +626,6 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
- assertTrue(testContainerView.getScrollX() > 0);
assertTrue(testContainerView.getScrollY() > 0);
}
});
« no previous file with comments | « no previous file | android_webview/lib/main/aw_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698