Bug 1145553 - Remove remaining usage of enablePrivilege in crashtests; r=jmaher
authorMartijn Wargers <mwargers@mozilla.com>
Fri, 20 Mar 2015 14:29:19 +0100
changeset 266436 7c2073c5cc7e3a1133937afd65b54d80aea424b2
parent 266435 8194018355f69c709cc4a7f9a2a4eb9894a1245d
child 266437 e0e5bd4702b302ccd29a5b2cdb34306599265574
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1145553
milestone39.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 1145553 - Remove remaining usage of enablePrivilege in crashtests; r=jmaher
gfx/tests/crashtests/358732-3.html
gfx/tests/crashtests/358732-iframe.html
layout/generic/crashtests/370174-3.html
layout/generic/crashtests/370174-4.html
--- a/gfx/tests/crashtests/358732-3.html
+++ b/gfx/tests/crashtests/358732-3.html
@@ -1,18 +1,17 @@
 <html>
 <head>
 <title>Testcase 3 - Bug 358732  Crash in _moz_cairo_win32_scaled_font_select_font, part 2</title>
 <script id="script">
 var i=0;
 function doe() {
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-var navigator1 = top.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
-var docShell = navigator1.QueryInterface(Components.interfaces.nsIDocShell);
-var docviewer = docShell.contentViewer;
+var navigator1 = SpecialPowers.wrap(top).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).getInterface(SpecialPowers.Ci.nsIWebNavigation);
+var docShell = navigator1.QueryInterface(SpecialPowers.Ci.nsIDocShell);
+var docviewer = docShell.contentViewer.QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
 docviewer.textZoom=i;
 i=i+0.2;
 if (i>10)
  i = 0;
 }
 setInterval(doe, 50);
 
 </script>
--- a/gfx/tests/crashtests/358732-iframe.html
+++ b/gfx/tests/crashtests/358732-iframe.html
@@ -7,20 +7,19 @@
 <script>
 var doc = document;
 if (document.getElementById('content')) {
   doc = document.getElementById('content').contentDocument;
 }
 
 var docviewer;
 function do_onload() {
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-var navigator = parent.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation);
-var docShell = navigator.QueryInterface(Components.interfaces.nsIDocShell);
-docviewer = docShell.contentViewer;
+var navigator1 = SpecialPowers.wrap(parent).QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).getInterface(SpecialPowers.Ci.nsIWebNavigation);
+var docShell = navigator1.QueryInterface(SpecialPowers.Ci.nsIDocShell);
+docviewer = docShell.contentViewer.QueryInterface(SpecialPowers.Ci.nsIMarkupDocumentViewer);
 
 setTimeout(doe,500, 0.2);
 }
 do_onload();
 
 
 
 function doe(i) {
--- a/layout/generic/crashtests/370174-3.html
+++ b/layout/generic/crashtests/370174-3.html
@@ -11,18 +11,16 @@ function doe2() {
 document.body.setAttribute('style', '');
 document.getElementsByTagName('head')[0].setAttribute('style', '');
 document.body.offsetHeight;
 document.getElementsByTagName('span')[0].setAttribute('style', 'display: table-row;');
 }
 setTimeout(doe2,100);
 
 function tripleclick(){
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-var wu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                .getInterface(Components.interfaces.nsIDOMWindowUtils);
+var wu = SpecialPowers.DOMWindowUtils;
 wu.sendMouseEvent('mousedown',  500, 500, 0, 3, 0);
 setTimeout(tripleclick,20);
 setTimeout(function(){window.location.reload()}, 200);
 }
 setTimeout(tripleclick,200);
 </SCRIPT>
 </BODY></HTML>
\ No newline at end of file
--- a/layout/generic/crashtests/370174-4.html
+++ b/layout/generic/crashtests/370174-4.html
@@ -7,17 +7,17 @@
 <style>
 
 
 </style>
 </head>
 <body>
 
 
-<iframe id="content" src="data:text/html;charset=utf-8,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%0A%3Cscript%3Enetscape.security.PrivilegeManager.enablePrivilege%28%22UniversalXPConnect%22%29%3B%0Avar%20wu%20%3D%20%20window.QueryInterface%28Components.interfaces.nsIInterfaceRequestor%29%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.getInterface%28Components.interfaces.nsIDOMWindowUtils%29%3B%0A%0Avar%20i%20%3D%20Math.floor%28Math.random%28%29*20%29%3B%0Awu.sendMouseEvent%28%27mousedown%27%2C%20%2020*i%2C%2020*i%2C%200%2C%203%2C%200%29%3B%0Awu.sendMouseEvent%28%27mouseup%27%2C%20%2020*i%2C%2020*i%2C%200%2C%203%2C%200%29%3B%0A%3C/script%3E%0A%0A%3Cembed%20type%3D%22bbb%22%20style%3D%22display%3A%20-moz-inline-stack%3B%22%3E%0A%0A%3C/body%3E%3C/html%3E" style="width:1000px;height: 700px;"></iframe>
+<iframe id="content" src="data:text/html;charset=utf-8,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody%3E%0A%3Cscript%3E%0Avar%20wu%20%3D%20SpecialPowers.DOMWindowUtils%3B%0Avar%20i%20%3D%20Math.floor%28Math.random%28%29*20%29%3B%0Awu.sendMouseEvent%28%27mousedown%27%2C%20%2020*i%2C%2020*i%2C%200%2C%203%2C%200%29%3B%0Awu.sendMouseEvent%28%27mouseup%27%2C%20%2020*i%2C%2020*i%2C%200%2C%203%2C%200%29%3B%0A%3C/script%3E%0A%0A%3Cembed%20type%3D%22bbb%22%20style%3D%22display%3A%20-moz-inline-stack%3B%22%3E%0A%0A%3C/body%3E%3C/html%3E%22%20style%3D%22width%3A1000px%3Bheight%3A%20700px%3B"></iframe>
 <script>
 function doe2() {
 document.getElementById('content').src = document.getElementById('content').src + '?1';
 
 }
 setInterval(doe2, 1000);
 </script>
 </body>