Bug 1026290: Delay mochitest-chrome redirect until after MozAfterPaint; r=jmaher
--- a/testing/mochitest/redirect.html
+++ b/testing/mochitest/redirect.html
@@ -12,18 +12,29 @@
detail: {
"data": aURL + location.search,
"type": "loadURI"
}
});
document.dispatchEvent(event);
}
+ function redirectToHarness()
+ {
+ redirect("chrome://mochikit/content/harness.xul");
+ }
+
function onLoad() {
- redirect("chrome://mochikit/content/harness.xul");
+ // Wait for MozAfterPaint, since the listener in browser-test.js is not
+ // added until then.
+ window.addEventListener("MozAfterPaint", function testOnMozAfterPaint() {
+ window.removeEventListener("MozAfterPaint", testOnMozAfterPaint);
+ setTimeout(redirectToHarness, 0);
+ });
+
}
</script>
</head>
<body onload="onLoad();">
redirecting...
</body>
</html>