Bug 942411 - Use SpecialPowers.pushPermissions to make sure the permission is set before test run. r=smaug, a=test-only
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Fri, 03 Oct 2014 18:31:22 +0800
changeset 216928 bbf1c4e2ddce
parent 216927 f0253d7268bb
child 216929 d126cd83b4b8
push id3973
push userryanvm@gmail.com
push date2014-10-03 21:41 +0000
treeherdermozilla-beta@bbf1c4e2ddce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs942411
milestone33.0
Bug 942411 - Use SpecialPowers.pushPermissions to make sure the permission is set before test run. r=smaug, a=test-only
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>