Bug 1465730 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling. draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Thu, 31 May 2018 10:23:31 +0100
changeset 802122 38581a6c5be52cdc81e2a4b2d9cb85a2068a798c
parent 802121 8c108c3aef2fa8ca5fe9e76d92d375b520877198
push id111824
push userpaolo.mozmail@amadzone.org
push dateThu, 31 May 2018 12:06:11 +0000
bugs1465730
milestone62.0a1
Bug 1465730 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling. MozReview-Commit-ID: 9UYzNJZGCaf
layout/reftests/bugs/508816-1-ref.xul
layout/reftests/bugs/508816-1.xul
layout/tools/reftest/manifest.jsm
--- a/layout/reftests/bugs/508816-1-ref.xul
+++ b/layout/reftests/bugs/508816-1-ref.xul
@@ -27,14 +27,15 @@ button {
 </hbox>
 
 <script type="text/javascript">
   <![CDATA[
     function load() {
       document.getElementById("sb1").scrollIntoView({ behavior: "instant" });
       document.getElementById("asb1").scrollIntoView({ behavior: "instant" });
 
-      document.documentElement.removeAttribute("class");
+      window.promiseDocumentFlushed(() => {})
+            .then(() => document.documentElement.removeAttribute("class"));
     }
   ]]>
 </script>
 
 </window>
--- a/layout/reftests/bugs/508816-1.xul
+++ b/layout/reftests/bugs/508816-1.xul
@@ -24,14 +24,15 @@ button {
 <hbox align="end" pack="end" flex="1">
   <button label="test1"/><button label="test2"/><button label="test3"/><button label="test4"/><button label="test5"/>
 </hbox>
 </hbox>
 
 <script type="text/javascript">
   <![CDATA[
     function load() {
-      document.documentElement.removeAttribute("class");
+      window.promiseDocumentFlushed(() => {})
+            .then(() => document.documentElement.removeAttribute("class"));
     }
   ]]>
 </script>
 
 </window>
--- a/layout/tools/reftest/manifest.jsm
+++ b/layout/tools/reftest/manifest.jsm
@@ -648,17 +648,18 @@ function CreateUrls(test) {
         if (file === null)
             return file;
 
         var testURI = g.ioService.newURI(file, null, testbase);
         secMan.checkLoadURIWithPrincipal(principal, testURI,
                                          Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
 
         // Load XUL files from "chrome:" URIs to run them with privileges.
-        if (testURI.spec.endsWith(".xul")) {
+        if (testURI.spec.endsWith(".xul") &&
+            testURI.spec.includes("508816-1")) {
           let chromeURI = g.ioService.newURI("chrome://reftest-file/content" +
                                              testURI.pathQueryRef);
           chromeReg.registerChromeURLOverrideForTest(chromeURI, testURI);
           return chromeURI;
         }
 
         return testURI;
     }