Bug 1331601 - RDM browser_device_change.js fix for subpixel size. r=me
MozReview-Commit-ID: 4fzMjF2O338
--- 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);