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 231873 90adfed296ed08bc7070974382ee0e482bb352f5
parent 231872 ec38ca9e23af33f5d2d28920064d3c3e8cd7c48d
child 231874 4b10e7038d3b476eedce95196b6c0593a61a5083
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs942411
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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>