js/xpconnect/tests/mochitest/test_bug553407.html
author Bobby Holley <bobbyholley@gmail.com>
Fri, 14 Oct 2011 10:52:47 -0700
changeset 78738 51541b56d20d588edc5a6111d670ca5af3db39d5
parent 74315 js/src/xpconnect/tests/mochitest/test_bug553407.html@1188456710819d4606e74396be333ead9fe63261
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=517163
-->
<head>
  <title>Test for Bug 553407</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=553407">Mozilla Bug 553407</a>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 553407 **/
is(typeof new XPCNativeWrapper(location), "object", "XPCNativeWrapper(location) is an object")
is(typeof new XPCNativeWrapper(XMLHttpRequest), "function", "XPCNativeWrapper(XMLHttpRequest) is a function")
// We no longer support .wrappedJSObject on NW since for same-origin there is no wrapper in between.
// is(typeof new XPCNativeWrapper(location).wrappedJSObject, "object", "XPCNativeWrapper(location).wrappedJSObject is an object")
// is(typeof new XPCNativeWrapper(XMLHttpRequest).wrappedJSObject, "function", "XPCNativeWrapper(XMLHttpRequest).wrappedJSObject is a function")
ok("a".replace("a", new XPCNativeWrapper(location)).indexOf("mochi.test") >= 0, "XPCNativeWrappers can be used as the replacement value for .replace");

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