diff options
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js')
-rw-r--r-- | testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js new file mode 100644 index 0000000000..f5edd7aed9 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-same-origin-domain.sub.window.js @@ -0,0 +1,14 @@ +// META: script=/html/resources/common.js +// META: script=resources/document-open-side-effects.js + +document.domain = "{{host}}"; + +testInIFrame("http://{{host}}:{{ports[http][1]}}/common/domain-setter.sub.html", (ctx) => { + const iframe = ctx.iframes[0]; + const origURL = iframe.contentDocument.URL; + assertDocumentIsReadyForSideEffectsTest(iframe.contentDocument, "same origin-domain (but not same origin) document"); + assert_throws_dom("SecurityError", iframe.contentWindow.DOMException, () => { + ctx.iframes[0].contentDocument.open(); + }, "document.open() should throw a SecurityError on a same origin-domain (but not same origin) document"); + assertOpenHasNoSideEffects(iframe.contentDocument, origURL, "same origin-domain (but not same origin) document"); +}, "document.open bailout should not have any side effects (same origin-domain (but not same origin) document)"); |