Bug 942411 - Use SpecialPowers.pushPermissions to make sure the permission is set before test run. r=smaug
--- a/content/html/content/test/test_ignoreuserfocus.html
+++ b/content/html/content/test/test_ignoreuserfocus.html
@@ -135,20 +135,23 @@
document.body.appendChild(witness);
document.body.appendChild(iframe);
document.body.appendChild(witness2);
iframe.setAttribute("src", "file_ignoreuserfocus.html");
}
addEventListener("load", function() {
- SpecialPowers.addPermission("browser", true, document);
- SpecialPowers.pushPrefEnv({
- "set": [
- ["dom.mozBrowserFramesEnabled", true]
- ]
- }, function() {
- SimpleTest.waitForFocus(runTest);
- });
+ SpecialPowers.pushPermissions(
+ [{'type': 'browser', 'allow': true, 'context': document}],
+ function() {
+ SpecialPowers.pushPrefEnv({
+ "set": [
+ ["dom.mozBrowserFramesEnabled", true]
+ ]
+ }, function() {
+ SimpleTest.waitForFocus(runTest);
+ });
+ });
});
</script>
</body>
</html>