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

Unified Diff: LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html

Issue 298133003: Expose fractional TouchEvent coordinates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make layout test output stable across platforms Created 6 years, 6 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
Index: LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
diff --git a/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
index 14fc6d034356f8216092665d599eb5f2aaf2d1ed..4aabc58638242d7f2557514afddd8e1a4e44f955 100644
--- a/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
+++ b/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
@@ -12,6 +12,7 @@
</div>
<script>
var event;
+ var floatPrecision = 0.00001;
function sendTouchStart(x, y)
{
@@ -67,10 +68,10 @@
{
event = e;
debug("\nJust zoomed");
- shouldBe("event.touches[0].clientX", "83");
- shouldBe("event.touches[0].clientY", "83");
- shouldBe("event.touches[0].pageX", "83");
- shouldBe("event.touches[0].pageY", "83");
+ shouldBeCloseTo("event.touches[0].clientX", 83.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].clientY", 83.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].pageX", 83.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].pageY", 83.33333, floatPrecision);
}
window.addEventListener("touchstart", justZoomed, false);
zoomPageIn();
@@ -99,10 +100,10 @@
{
event = e;
debug("\nZoomed and scrolled");
- shouldBe("event.touches[0].clientX", "84");
- shouldBe("event.touches[0].clientY", "84");
- shouldBe("event.touches[0].pageX", "133");
- shouldBe("event.touches[0].pageY", "133");
+ shouldBeCloseTo("event.touches[0].clientX", 83.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].clientY", 83.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].pageX", 133.33333, floatPrecision);
+ shouldBeCloseTo("event.touches[0].pageY", 133.33333, floatPrecision);
}
window.addEventListener("touchstart", zoomedAndScrolled, false);
zoomPageIn();

Powered by Google App Engine
This is Rietveld 408576698