Bug 688416: Test for Bug 502959 relies on XHR event listener being an nsIDOMEventListener. r=mrbkap
authorKyle Huey <khuey@kylehuey.com>
Thu, 29 Sep 2011 12:06:35 -0400
changeset 77811 79f7d54a4cc360ee5870caa6f70c7b4ca60c1b9f
parent 77810 e3bf1ee4ea81b6af11bc97f4526935c9d5f8544f
child 77812 60e2cfb98a5268e256bc2ebabfc6b7f9eede722f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmrbkap
bugs688416, 502959
milestone10.0a1
Bug 688416: Test for Bug 502959 relies on XHR event listener being an nsIDOMEventListener. r=mrbkap
js/src/xpconnect/tests/mochitest/test_bug502959.html
--- a/js/src/xpconnect/tests/mochitest/test_bug502959.html
+++ b/js/src/xpconnect/tests/mochitest/test_bug502959.html
@@ -13,25 +13,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 502959 **/
-var xhr = new XMLHttpRequest();
+// Whatever you do don't use the word "wrapped" in this function.
+function foo() {
+  ok(true, "Able to call the function");
+}
 
-xhr.onreadystatechange = function() { ok(true, "Able to call the double-wrapped function"); };
-var doublewrapped = xhr.onreadystatechange;
+var iter = document.createNodeIterator(document, NodeFilter.SHOW_ELEMENT, foo, false);
+var doublewrapped = iter.filter;
+
 ok(doublewrapped.toString().indexOf("wrapped") > 0, "got a double-wrapped object back");
 
 (function () {
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     Components.utils.forceGC();
 })();
 
-doublewrapped.handleEvent({});
+doublewrapped.acceptNode(document);
 
 </script>
 </pre>
 </body>
 </html>