Bug 1375012 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling. draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Fri, 01 Jun 2018 11:18:02 +0100
changeset 802732 01f3bdad75bea63f0b6f5a39844e4f89729cd78e
parent 802731 ec358b587f745a989fe3ed92a13955b8da59bc75
push id111935
push userpaolo.mozmail@amadzone.org
push dateFri, 01 Jun 2018 10:23:26 +0000
bugs1375012
milestone62.0a1
Bug 1375012 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling. MozReview-Commit-ID: JKK0JqG1y1p
layout/reftests/bugs/508816-1-ref.xul
layout/reftests/bugs/508816-1.xul
layout/reftests/bugs/reftest.list
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
@@ -1,11 +1,11 @@
 <?xml version="1.0"?>
 <!DOCTYPE window>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="RTL overflow test" width="640px" height="480px" style="direction: rtl">
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="RTL overflow test" width="640px" height="480px" style="direction: rtl" onload="load()" class="reftest-wait">
 
 <style type="text/css" xmlns="http://www.w3.org/1999/xhtml"><![CDATA[
 button {
   margin: 0;
 }
 ]]></style>
 
 <hbox style="max-width: 200px; border: 1px solid red;">
@@ -21,9 +21,18 @@ button {
 </hbox>
 
 <hbox style="max-width: 200px; border: 1px solid black">
 <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() {
+      window.promiseDocumentFlushed(() => {})
+            .then(() => document.documentElement.removeAttribute("class"));
+    }
+  ]]>
+</script>
+
 </window>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1405,17 +1405,17 @@ needs-focus fails == 503531-1.html 50353
 fuzzy-if(Android,5,2800) == 506481-1.html 506481-1-ref.html
 == 507187-1.html 507187-1-ref.html
 == 507487-1.html 507487-1-ref.html
 == 507487-2.xhtml 507487-2-ref.xhtml
 == 507762-1.html 507762-1-ref.html
 == 507762-2.html 507762-2-ref.html
 == 507762-3.html 507762-1-ref.html
 == 507762-4.html 507762-2-ref.html
-random == 508816-1.xul 508816-1-ref.xul # Bug 1375012
+== 508816-1.xul 508816-1-ref.xul
 == 508816-2.html 508816-2-ref.html
 skip-if(isDebugBuild) == 508908-1.xul 508908-1-ref.xul
 == 508919-1.xhtml 508919-1-ref.xhtml
 == 509155-1.xhtml 509155-1-ref.xhtml
 fuzzy-if(Android,5,1656) fuzzy-if(skiaContent,1,1200) == 512410.html 512410-ref.html
 == 512631-1.html 512631-1-ref.html
 == 513153-1a.html 513153-1-ref.html
 == 513153-1b.html 513153-1-ref.html
--- 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;
     }