tor-browser

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

test_remoteProxyAsPrototype.html (1090B)


      1 <!-- Any copyright is dedicated to the Public Domain.
      2 - http://creativecommons.org/publicdomain/zero/1.0/ -->
      3 <!DOCTYPE HTML>
      4 <html>
      5 <head>
      6 <title>Test for bug 1773732</title>
      7 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      9 </head>
     10 <body>
     11 <script>
     12 
     13 SimpleTest.waitForExplicitFinish();
     14 
     15 function go() {
     16  let frame = document.createElement("iframe");
     17  frame.onload = () => {
     18    let win = frame.contentWindow;
     19 
     20    // The processes will be remote only with isolateEverything strategy
     21    const expected = SpecialPowers.effectiveIsolationStrategy() == SpecialPowers.ISOLATION_STRATEGY.IsolateEverything;
     22 
     23    is(SpecialPowers.Cu.isRemoteProxy(win), expected,
     24       "win is a remote proxy if Fission is enabled and strategy is isolateEverything");
     25    let o = {};
     26    Object.setPrototypeOf(o, win);
     27    is(Object.getPrototypeOf(o), win, "should have expected proto");
     28    SimpleTest.finish();
     29  };
     30  frame.src = "https://example.com";
     31  document.body.appendChild(frame);
     32 };
     33 go();
     34 
     35 </script>
     36 </body>
     37 </html>