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

Unified Diff: LayoutTests/fast/events/scale-and-scroll-div.html

Issue 610423004: Preserve fractional scroll offset for JS scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 2 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 | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/events/scale-and-scroll-div-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/scale-and-scroll-div.html
diff --git a/LayoutTests/fast/events/scale-and-scroll-div.html b/LayoutTests/fast/events/scale-and-scroll-div.html
index c2d2551948554f095ee0c3c938b04a5f650b371a..8631f403681aaffcb86f312584ced9d23f27e053 100644
--- a/LayoutTests/fast/events/scale-and-scroll-div.html
+++ b/LayoutTests/fast/events/scale-and-scroll-div.html
@@ -23,12 +23,13 @@
</style>
<script>
+ var floatPrecision = 0.1;
var scrollDistance = 10;
var expectedScrollDistance;
var scrollBox;
function scroll(scaleFactor) {
- expectedScrollDistance = Math.floor(scrollDistance/scaleFactor);
+ expectedScrollDistance = scrollDistance/scaleFactor;
scrollBox.scrollTop = 0;
@@ -38,7 +39,7 @@
}
eventSender.gestureScrollEnd(0, 0);
- shouldBe('scrollBox.scrollTop', 'expectedScrollDistance');
+ shouldBeCloseTo('scrollBox.scrollTop', expectedScrollDistance, floatPrecision);
scrollBox.scrollTop = 20;
@@ -48,9 +49,9 @@
}
eventSender.gestureScrollEnd(0, 0);
- expectedScrollDistance = Math.floor(20 - scrollDistance/scaleFactor);
+ expectedScrollDistance = 20 - scrollDistance/scaleFactor;
- shouldBe('scrollBox.scrollTop', 'expectedScrollDistance');
+ shouldBeCloseTo('scrollBox.scrollTop', expectedScrollDistance, floatPrecision);
}
function scaleWithEventSender(scaleFactor) {
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/events/scale-and-scroll-div-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698