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

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

Issue 870363005: Remove scroll_delta flooring hack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months 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 | « android_webview/browser/hardware_renderer.h ('k') | cc/layers/layer_impl.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 a5d73234a1da62fd8f81794e84e139e15ee5a03e..9224b2bda0c6e0be0817ff1651225dca5c8aefb9 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
@@ -219,7 +219,7 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
private void assertScrollInJs(final AwContents awContents,
final TestAwContentsClient contentsClient,
- final int xCss, final int yCss) throws Exception {
+ final double xCss, final double yCss) throws Exception {
poll(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
@@ -227,8 +227,8 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
"window.scrollX");
String y = executeJavaScriptAndWaitForResult(awContents, contentsClient,
"window.scrollY");
- return (Integer.toString(xCss).equals(x)
- && Integer.toString(yCss).equals(y));
+ return (Math.abs(xCss - Double.parseDouble(x)) < 0.001
+ && Math.abs(yCss - Double.parseDouble(y)) < 0.001);
}
});
}
@@ -421,8 +421,8 @@ public class AndroidScrollIntegrationTest extends AwTestBase {
// Make sure we can't hit these values simply as a result of scrolling.
assert (maxScrollXPix % dragStepSize) != 0;
assert (maxScrollYPix % dragStepSize) != 0;
- final int maxScrollXCss = (int) Math.floor(maxScrollXPix / deviceDIPScale);
- final int maxScrollYCss = (int) Math.floor(maxScrollYPix / deviceDIPScale);
+ final double maxScrollXCss = maxScrollXPix / deviceDIPScale;
+ final double maxScrollYCss = maxScrollYPix / deviceDIPScale;
setMaxScrollOnMainSync(testContainerView, maxScrollXPix, maxScrollYPix);
« no previous file with comments | « android_webview/browser/hardware_renderer.h ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698