Bug 914847. Modify metro mochitests to flush styles. r=mbrubeck
authorJim Mathies <jmathies@mozilla.com>
Tue, 22 Oct 2013 14:13:26 +0200
changeset 164120 b07b7fca7f6c44d16d0b514160ff01f494023443
parent 164119 8aacc8a6747279c7846a376678b93654e7fac008
child 164121 28686e41cdf836698b4388122c0563e1e2e40bf3
push id26026
push userphilringnalda@gmail.com
push dateSat, 18 Jan 2014 23:17:27 +0000
treeherdermozilla-central@61fd0f987cf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs914847
milestone29.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 914847. Modify metro mochitests to flush styles. r=mbrubeck
browser/metro/base/tests/mochitest/head.js
--- a/browser/metro/base/tests/mochitest/head.js
+++ b/browser/metro/base/tests/mochitest/head.js
@@ -877,16 +877,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);
@@ -904,17 +906,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);