Bug 914847. Modify metro mochitests to flush styles. r=mbrubeck, a=1.3+
authorJim Mathies <jmathies@mozilla.com>
Tue, 22 Oct 2013 14:13:26 +0200
changeset 175899 c6e3ddc8d831928eea5fedc0c0d4bd33d7c8a12f
parent 175898 b7a571142fa5b209da747304b62156cf003bcf4a
child 175900 6f7dfe36ab6c115e2c4e6eb21d71cfbee659d3f2
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, 1
bugs914847
milestone28.0a2
Bug 914847. Modify metro mochitests to flush styles. r=mbrubeck, a=1.3+
browser/metro/base/tests/mochitest/head.js
--- a/browser/metro/base/tests/mochitest/head.js
+++ b/browser/metro/base/tests/mochitest/head.js
@@ -894,16 +894,18 @@ TouchDragAndHold.prototype = {
     this._utils = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIDOMWindowUtils);
     this._endPoint = { xPos: aEndX, yPos: aEndY };
     this._currentPoint = { xPos: aStartX, yPos: aStartY };
     this._step = { steps: 0, x: (aEndX - aStartX) / this._numSteps, y: (aEndY - aStartY) / this._numSteps };
     if (this._debug) {
       info("[0] touchstart " + aStartX + " x " + aStartY);
     }
+    // flush layout, bug 914847
+    this._utils.elementFromPoint(aStartX, aStartY, false, true);
     if (this._native) {
       this._utils.sendNativeTouchPoint(this._pointerId, this._dui.TOUCH_CONTACT,
                                        aStartX, aStartY, 1, 90);
     } else {
       EventUtils.synthesizeTouchAtPoint(aStartX, aStartY, { type: "touchstart" }, aWindow);
     }
     let self = this;
     setTimeout(function () { self.callback(); }, this._timeoutStep);
@@ -921,17 +923,17 @@ TouchDragAndHold.prototype = {
                    x: (aEndX - this._endPoint.xPos) / this._numSteps,
                    y: (aEndY - this._endPoint.yPos) / this._numSteps };
     this._endPoint = { xPos: aEndX, yPos: aEndY };
     let self = this;
     setTimeout(function () { self.callback(); }, this._timeoutStep);
     return this._defer.promise;
   },
 
-  end: function start() {
+  end: function end() {
     if (this._debug) {
       info("[" + this._step.steps + "] touchend " + this._endPoint.xPos + " x " + this._endPoint.yPos);
       SelectionHelperUI.debugClearDebugPoints();
     }
     if (this._native) {
       this._utils.sendNativeTouchPoint(this._pointerId, this._dui.TOUCH_REMOVE,
                                        this._endPoint.xPos, this._endPoint.yPos,
                                        1, 90);