chrome_wrappers_helper.html 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <html>
  2. <head>
  3. <script>
  4. function check_wrapper(ok, wrapper, expected, note) {
  5. var utils = SpecialPowers.DOMWindowUtils;
  6. ok(utils.getClassName(wrapper) === expected, note);
  7. }
  8. function run_test(ok, xpcnw, sjow) {
  9. // both wrappers should point to our window: XOW
  10. check_wrapper(ok, ok, "Proxy", "functions are wrapped properly")
  11. check_wrapper(ok, xpcnw, "Proxy", "XPCNWs are transformed correctly");
  12. check_wrapper(ok, sjow, "Proxy", "SJOWs are transformed correctly");
  13. check_wrapper(ok, window.location, "Proxy",
  14. "Content needs a same-compartment security wrappers around location");
  15. ok(defprop1 === 1, "defprop1 exists");
  16. window.defprop1 = 2;
  17. ok(defprop1 === 2, "defprop1 is properly writable");
  18. // defprop2 = {}; disabled because the test doesn't work
  19. }
  20. window.xhr = new XMLHttpRequest();
  21. </script>
  22. </head>
  23. <body>
  24. </body>
  25. </html>