Bug 1248817 - Make test_domwindowutils.html more forgiving of coordinate rounding; r=ochameau
authorGeoff Brown <gbrown@mozilla.com>
Fri, 26 Feb 2016 14:01:11 -0700
changeset 322217 9334bc77b215b0de34707b4272609cd30e185dee
parent 322216 ef98cb11ba628036598b533a467dea2348a840f0
child 322218 9a3b944c3251624ad4ef213f19a1e3956e39bc0e
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1248817
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1248817 - Make test_domwindowutils.html more forgiving of coordinate rounding; r=ochameau
dom/base/test/test_domwindowutils.html
--- a/dom/base/test/test_domwindowutils.html
+++ b/dom/base/test/test_domwindowutils.html
@@ -15,18 +15,19 @@ SimpleTest.waitForExplicitFinish();
 var utils = SpecialPowers.getDOMWindowUtils(window);
 function test_sendMouseEventDefaults() {
   var x = 1, y = 2, button = 1, clickCount = 2,
       modifiers = SpecialPowers.Ci.nsIDOMNSEvent.SHIFT_MASK;
 
   window.addEventListener("mousedown", function listener(evt) {
     window.removeEventListener("mousedown", listener);
     // Mandatory args
-    is(evt.clientX, x, "check x");
-    is(evt.clientY, y, "check y");
+    // coordinates may change slightly due to rounding
+    ok((evt.clientX <= x+2) && (evt.clientX >= x-2), "check x");
+    ok((evt.clientY <= y+2) && (evt.clientY >= y-2), "check y");
     is(evt.button, button, "check button");
     is(evt.detail, clickCount, "check click count");
     is(evt.getModifierState("Shift"), true, "check modifiers");
 
     // Default value for optionals
     is(evt.mozPressure, 0, "check pressure");
     is(evt.mozInputSource, SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE, "check input source");
     is(evt.isSynthesized, undefined, "check isSynthesized is undefined in content");