diff options
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html')
-rw-r--r-- | testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html new file mode 100644 index 0000000000..118be71af1 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/origin-check-in-document-open-basic.html @@ -0,0 +1,26 @@ +<!doctype html> +<title>Origin check in document.open() - Basic usage</title> +<link rel="author" title="Jochen Eisinger" href="mailto:jochen@chromium.org"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#opening-the-input-stream"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/resources/common.js"></script> +<body> +<script> +testInIFrame(undefined, (ctx) => { + try { + ctx.iframes[0].contentDocument.open(); + } catch (e) { + assert_unreached("Opening a same origin document throws"); + } +}, "It should be possible to open same origin documents."); + +testInIFrame(undefined, (ctx) => { + try { + ctx.iframes[0].contentDocument.write(""); + } catch (e) { + assert_unreached("Implicitly opening a same origin document throws"); + } +}, "It should be possible to implicitly open same origin documents."); +</script> +</body> |