summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_sandbox_structuredclone.html
blob: 38663d7a037c24e370a39dced5cf1eceb0dda5a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for structured clone deserialization in a sandbox</title>
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
</head>
<body>

  <script type="application/javascript">
    "use strict";

    let sandbox = new Cu.Sandbox(window, { sandboxPrototype: window });
    let holder = new StructuredCloneHolder("", "", new Blob([]), sandbox);
    let result = holder.deserialize(sandbox);
    ok(sandbox.Blob.isInstance(result),
       "Deserializing into a sandbox with a DOM global as its prototype should work");

  </script>
</body>
</html>