summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-same-origin-iframe-test.sub.mjs
blob: 272f805870c932377b80b442f850d55018fdf0dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {
  navigateIframe,
  testGetter
} from "../../resources/helpers.mjs";

export default ({ expected }) => {
  // We do this manually instead of using insertIframe because we want to add a
  // sandbox="" attribute and we don't want to set both document.domains.
  promise_setup(() => {
    const iframe = document.createElement("iframe");
    iframe.sandbox = "allow-scripts allow-same-origin";
    const navigatePromise = navigateIframe(iframe, "{{hosts[][]}}", "?1");
    document.body.append(iframe);
    return navigatePromise;
  });

  // Since the allow-same-origin token is set, this should behave like a normal
  // iframe, and follow the embedder.
  testGetter(0, expected);
};