Bug 1465730 - Wait for a layout flush in the reftest for "arrowscrollbox" scrolling.
MozReview-Commit-ID: 9UYzNJZGCaf
--- 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;
}