test_bug448587.xul 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
  3. <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
  4. <!--
  5. https://bugzilla.mozilla.org/show_bug.cgi?id=448587.xul
  6. -->
  7. <window title="Mozilla Bug 503926"
  8. xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  9. <script type="application/javascript"
  10. src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  11. <!-- test results are displayed in the html:body -->
  12. <body xmlns="http://www.w3.org/1999/xhtml">
  13. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=448587"
  14. target="_blank">Mozilla Bug 448587</a>
  15. </body>
  16. <!-- test code goes here -->
  17. <script type="application/javascript">
  18. <![CDATA[
  19. // Bonus test - collaborate with test_bug361111.xul to make sure that
  20. // flushPrefEnv is appropriately called.
  21. ok(!SpecialPowers.Services.prefs.prefHasUserValue('testing.some_arbitrary_pref'),
  22. "Pref shouldn't carry over from previous test!");
  23. /** Test for Bug 448587 **/
  24. const Cu = Components.utils;
  25. var sandbox = new Cu.Sandbox("about:blank");
  26. var fwrapper = Cu.evalInSandbox("function f() {} f", sandbox);
  27. is(Cu.unwaiveXrays(Cu.waiveXrays(fwrapper).prototype), Cu.evalInSandbox("f.prototype", sandbox),
  28. ".prototype visible through .wrappedJSObject");
  29. is(fwrapper.prototype, undefined, ".prototype invisible through Xrays");
  30. ]]>
  31. </script>
  32. </window>