tor-browser

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

test_sandbox_structuredclone.html (712B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test for structured clone deserialization in a sandbox</title>
      5  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
      7 </head>
      8 <body>
      9 
     10  <script type="application/javascript">
     11    "use strict";
     12 
     13    let sandbox = new Cu.Sandbox(window, { sandboxPrototype: window });
     14    let holder = new StructuredCloneHolder("", "", new Blob([]), sandbox);
     15    let result = holder.deserialize(sandbox);
     16    ok(sandbox.Blob.isInstance(result),
     17       "Deserializing into a sandbox with a DOM global as its prototype should work");
     18 
     19  </script>
     20 </body>
     21 </html>