js/xpconnect/tests/mochitest/test_bug502959.html
author Bobby Holley <bobbyholley@gmail.com>
Fri, 14 Oct 2011 10:52:47 -0700
changeset 78738 51541b56d20d588edc5a6111d670ca5af3db39d5
parent 77811 js/src/xpconnect/tests/mochitest/test_bug502959.html@79f7d54a4cc360ee5870caa6f70c7b4ca60c1b9f
child 105267 f93960a93ad97a56d308bd9ce25d97cbc175d524
permissions -rw-r--r--
Bug 691411 - Move js/src/xpconnect to js/xpconnect and rename source files while we're at it. r=khuey, sr=mrbkap

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=502959
-->
<head>
  <title>Test for Bug 502959</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=502959">Mozilla Bug 502959</a>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 502959 **/
// Whatever you do don't use the word "wrapped" in this function.
function foo() {
  ok(true, "Able to call the function");
}

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.acceptNode(document);

</script>
</pre>
</body>
</html>