Bug 942411 - Use SpecialPowers.pushPermissions to make sure the permission is set before test run. r=smaug
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Fri, 03 Oct 2014 18:31:22 +0800
changeset 208658 90adfed296ed08bc7070974382ee0e482bb352f5
parent 208657 ec38ca9e23af33f5d2d28920064d3c3e8cd7c48d
child 208659 4b10e7038d3b476eedce95196b6c0593a61a5083
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmaug
bugs942411
milestone35.0a1
Bug 942411 - Use SpecialPowers.pushPermissions to make sure the permission is set before test run. r=smaug
content/html/content/test/test_ignoreuserfocus.html
--- 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>