Bug 825527 - Part 1: Look through an Xray wrapper at our images in tests so that we always see the QueryInterface method on them; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 02 Jan 2013 21:26:43 -0500
changeset 126537 fc28093525ac0a225abeab4e651430ae23598fa0
parent 126536 2fe6de3ac044c73d85a68735f4d8f9bc4a5648d8
child 126538 e3a0ca11961e35b4805ee195ade676032d8ca65a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs825527
milestone20.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 825527 - Part 1: Look through an Xray wrapper at our images in tests so that we always see the QueryInterface method on them; r=bzbarsky
image/test/mochitest/imgutils.js
image/test/mochitest/test_bug614392.html
--- a/image/test/mochitest/imgutils.js
+++ b/image/test/mochitest/imgutils.js
@@ -31,17 +31,17 @@ function isImageLoaded(id)
 
 // Helper function to get the status flags of an image
 function getImageStatus(id)
 {
   // Escalate
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
   // Get the image
-  var img = document.getElementById(id);
+  var img = SpecialPowers.wrap(document.getElementById(id));
 
   // QI the image to nsImageLoadingContent
   img.QueryInterface(SpecialPowers.Ci.nsIImageLoadingContent);
 
   // Get the request
   var request = img.getRequest(SpecialPowers.Ci
                                          .nsIImageLoadingContent
                                          .CURRENT_REQUEST);
--- a/image/test/mochitest/test_bug614392.html
+++ b/image/test/mochitest/test_bug614392.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 /** Test for Bug 614392**/
 
 SimpleTest.waitForExplicitFinish();
 
 window.onload = function() {
   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-  var img = document.getElementsByTagName("img")[0];
+  var img = SpecialPowers.wrap(document.getElementsByTagName("img")[0]);
   var container = img
       .QueryInterface(Components.interfaces.nsIImageLoadingContent)
       .getRequest(Components.interfaces.nsIImageLoadingContent.CURRENT_REQUEST)
       .image;
 
   container.animationMode =
       Components.interfaces.imgIContainer.kDontAnimMode;