tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

chrome_wrappers_helper.html (1142B)


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