Commit 9526bf22 authored by Jaebaek Seo's avatar Jaebaek Seo Committed by Commit Bot

aw scroll instrumentation test has precision issue

AndroidScrollIntegrationTest.testUiScrollReflectedInJs has a precision issue
when enabling --use-zoom-for-dsf. It is the same problem with the one described
in crrev.com/c/844266. In crrev.com/c/844266, I did not apply the same thing to
AndroidScrollIntegrationTest.testUiScrollReflectedInJs as a mistake.

Bug: 737777
Change-Id: I9474e8cf424ed2bf6b10578ab3c7ff7fbf8b6c4b
Reviewed-on: https://chromium-review.googlesource.com/892782Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Jaebaek Seo <jaebaek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533127}
parent 76da73ab
...@@ -324,6 +324,13 @@ public class AndroidScrollIntegrationTest { ...@@ -324,6 +324,13 @@ public class AndroidScrollIntegrationTest {
final int targetScrollYPix = (int) Math.ceil(targetScrollYCss * deviceDIPScale); final int targetScrollYPix = (int) Math.ceil(targetScrollYCss * deviceDIPScale);
final JavascriptEventObserver onscrollObserver = new JavascriptEventObserver(); final JavascriptEventObserver onscrollObserver = new JavascriptEventObserver();
double expectedScrollXCss = targetScrollXCss;
double expectedScrollYCss = targetScrollYCss;
if (UseZoomForDSFPolicy.isUseZoomForDSFEnabled()) {
expectedScrollXCss = (double) targetScrollXPix / deviceDIPScale;
expectedScrollYCss = (double) targetScrollYPix / deviceDIPScale;
}
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> InstrumentationRegistry.getInstrumentation().runOnMainSync(() ->
onscrollObserver.register(testContainerView.getWebContents(), "onscrollObserver")); onscrollObserver.register(testContainerView.getWebContents(), "onscrollObserver"));
...@@ -332,8 +339,8 @@ public class AndroidScrollIntegrationTest { ...@@ -332,8 +339,8 @@ public class AndroidScrollIntegrationTest {
scrollToOnMainSync(testContainerView, targetScrollXPix, targetScrollYPix); scrollToOnMainSync(testContainerView, targetScrollXPix, targetScrollYPix);
onscrollObserver.waitForEvent(WAIT_TIMEOUT_MS); onscrollObserver.waitForEvent(WAIT_TIMEOUT_MS);
assertScrollInJs(testContainerView.getAwContents(), contentsClient, assertScrollInJs(testContainerView.getAwContents(), contentsClient, expectedScrollXCss,
targetScrollXCss, targetScrollYCss); expectedScrollYCss);
} }
@Test @Test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment