Bug 775868 - fix more tests. r=bholley a=akeybl
authorAndrew McCreight <amccreight@mozilla.com>
Tue, 25 Sep 2012 09:51:05 -0700
changeset 82002 92fa61f340bd0ba4e0fcd319b97175bafaac7b89
parent 82001 877420b7c10f594776cdf2b82172938634ede96e
child 82003 89026001a0a9980bbecd39f1a64f361b724be05f
push id277
push useramccreight@mozilla.com
push dateTue, 25 Sep 2012 16:54:23 +0000
reviewersbholley, akeybl
bugs775868
milestone10.0.8esrpre
Bug 775868 - fix more tests. r=bholley a=akeybl
dom/tests/mochitest/bugs/test_bug534149.html
dom/tests/mochitest/general/489127.html
--- a/dom/tests/mochitest/bugs/test_bug534149.html
+++ b/dom/tests/mochitest/bugs/test_bug534149.html
@@ -39,39 +39,43 @@ var [i2outer, i2inner] = getIDs(i2);
 is(i1inner, i1outer + 1, "For frame 1, inner should come right after outer");
 is(i2inner, i2outer + 1, "For frame 2, inner should come right after outer");
 is(i2outer, i1inner + 1, "Frame 2 comes right after frame 1");
 
 var innerWindowDestroyID;
 var outerWindowDestroyID;
 
 function outerObserver(id) {
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   outerWindowDestroyID =
-    SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
+    id.QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
 }
 function innerObserver(id) {
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
   innerWindowDestroyID =
-   SpecialPowers.wrap(id).QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
+    id.QueryInterface(Components.interfaces.nsISupportsPRUint64).data;
 }
 
 function removeFrame(iframe) {
-  var obsSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+  var obsSvc = Components.classes["@mozilla.org/observer-service;1"]
                          .getService(Components.interfaces.nsIObserverService);
   obsSvc.addObserver(outerObserver, "outer-window-destroyed", false);
   obsSvc.addObserver(innerObserver, "inner-window-destroyed", false);
 
   iframe.parentNode.removeChild(iframe);
 }
 
 removeFrame(i1);
 SimpleTest.waitForExplicitFinish();
 SimpleTest.executeSoon(function() {
   is(innerWindowDestroyID, i1inner, "inner window of frame 1 should be destroyed");
   is(outerWindowDestroyID, i1outer, "outer window of frame 1 should be destroyed");
-  var obsSvc = SpecialPowers.wrap(Components).classes["@mozilla.org/observer-service;1"]
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+  var obsSvc = Components.classes["@mozilla.org/observer-service;1"]
                          .getService(Components.interfaces.nsIObserverService);
   obsSvc.removeObserver(outerObserver, "outer-window-destroyed");
   obsSvc.removeObserver(innerObserver, "inner-window-destroyed");
   SimpleTest.finish();
 });
   
 
 </script>
--- a/dom/tests/mochitest/general/489127.html
+++ b/dom/tests/mochitest/general/489127.html
@@ -6,20 +6,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
 <script type="application/javascript;version=1.8">
 
   let SimpleTest = window.opener.SimpleTest;
   function ok() { window.opener.ok.apply(window.opener, arguments); }
   function done() { window.opener.done.apply(window.opener, arguments); }
   let e = {};
 
-  // Enable privileges so we can use nsIDOMWindowUtils interface
-  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  let dwu = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
-                  .getInterface(Components.interfaces.nsIDOMWindowUtils);
+  let dwu = SpecialPowers.DOMWindowUtils;
 
   /*
     nsIDOMNodeList nodesFromRect(in float aX,
                                  in float aY,
                                  in float aTopSize, 
                                  in float aRightSize,
                                  in float aBottomSize,
                                  in float aLeftSize,