Bug 1339317 - Make browser_windowopen_reflows.js more resilient to compositor races. r=Gijs
authorMike Conley <mconley@mozilla.com>
Fri, 17 Feb 2017 13:52:48 -0500
changeset 344024 5b31af0f059b0870e505d604b61f5b55a7886f03
parent 344023 e9d22cbba1cc96e37cd24c8743064de82b637bff
child 344025 2dfdb769500417709bbdcf9da74b24df6d4d27b7
push id31396
push userkwierso@gmail.com
push dateWed, 22 Feb 2017 01:05:24 +0000
treeherdermozilla-central@47725823427b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1339317
milestone54.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 1339317 - Make browser_windowopen_reflows.js more resilient to compositor races. r=Gijs MozReview-Commit-ID: IsPJ4hzFQ4b
browser/base/content/test/general/browser_windowopen_reflows.js
--- a/browser/base/content/test/general/browser_windowopen_reflows.js
+++ b/browser/base/content/test/general/browser_windowopen_reflows.js
@@ -103,15 +103,19 @@ var observer = {
     // We're not interested in interruptible reflows.
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
                                          Ci.nsISupportsWeakReference])
 };
 
 function waitForMozAfterPaint(win, callback) {
+  let dwu = win.QueryInterface(Ci.nsIInterfaceRequestor)
+               .getInterface(Ci.nsIDOMWindowUtils);
+  let lastTransactionId = dwu.lastTransactionId;
+
   win.addEventListener("MozAfterPaint", function onEnd(event) {
-    if (event.target != win)
+    if (event.target != win || event.transactionId <= lastTransactionId)
       return;
     win.removeEventListener("MozAfterPaint", onEnd);
     executeSoon(callback);
   });
 }