Bug 1331601 - RDM browser_device_change.js fix for subpixel size. r=jryans
authorJ. Ryan Stinnett <jryans@gmail.com>
Thu, 19 Jan 2017 16:28:50 -0600
changeset 464577 bdfebb742afe2d328e63fefb08ba283cc95718e7
parent 464576 0de2f57ed353e10176053d1e83f95d42f031c1be
child 464578 ea5dac2d3a458a09bf0df4ee8e8b8c8c07a0b7d7
push id42370
push usermwein@mozilla.com
push dateSat, 21 Jan 2017 03:10:58 +0000
reviewersjryans
bugs1331601
milestone53.0a1
Bug 1331601 - RDM browser_device_change.js fix for subpixel size. r=jryans MozReview-Commit-ID: 4fzMjF2O338
devtools/client/responsive.html/test/browser/head.js
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -187,18 +187,18 @@ function getElRect(selector, win) {
  * Drag an element identified by 'selector' by [x,y] amount. Returns
  * the rect of the dragged element as it was before drag.
  */
 function dragElementBy(selector, x, y, win) {
   let React = win.require("devtools/client/shared/vendor/react");
   let { Simulate } = React.addons.TestUtils;
   let rect = getElRect(selector, win);
   let startPoint = {
-    clientX: rect.left + Math.floor(rect.width / 2),
-    clientY: rect.top + Math.floor(rect.height / 2),
+    clientX: Math.floor(rect.left + rect.width / 2),
+    clientY: Math.floor(rect.top + rect.height / 2),
   };
   let endPoint = [ startPoint.clientX + x, startPoint.clientY + y ];
 
   let elem = win.document.querySelector(selector);
 
   // mousedown is a React listener, need to use its testing tools to avoid races
   Simulate.mouseDown(elem, startPoint);