summaryrefslogtreecommitdiffstats
path: root/dom/security/test/csp/test_bug1738418.html
blob: 9fdc723b80359d34571f9eadf961cfc95eef360e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE HTML>
<html>
<head>
  <title>Bug 1738418: CSP sandbox for embed/object frames</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe id="testframe"></iframe>
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();

var elements = new Set(["iframe", "embed", "object"]);

window.addEventListener("message", event => {
  is(event.data.domain, "", `document in <${event.data.element}> should have sandboxed origin`);
  elements.delete(event.data.element);
  if (elements.size == 0) {
    SimpleTest.finish();
  }
});

document.getElementById("testframe").src = "file_bug1738418_parent.html";

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