summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/embed-img-and-message-top.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/web-platform/tests/content-security-policy/embedded-enforcement/support/embed-img-and-message-top.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/embed-img-and-message-top.html b/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/embed-img-and-message-top.html
new file mode 100644
index 0000000000..ab0e22d82f
--- /dev/null
+++ b/testing/web-platform/tests/content-security-policy/embedded-enforcement/support/embed-img-and-message-top.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <script>
+ function addImage() {
+ let img = document.createElement('img');
+ img.onload = () => top.postMessage('img loaded', '*');
+ img.onerror = () => top.postMessage('img blocked', '*');
+ img.src = '/content-security-policy/support/pass.png';
+ document.body.appendChild(img);
+ }
+ </script>
+ <body onpageshow="addImage();">
+ </body>
+</html>