diff options
Diffstat (limited to 'testing/web-platform/tests/storage-access-api/resources')
5 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.html b/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.html new file mode 100644 index 0000000000..d57c3961e5 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.html @@ -0,0 +1,8 @@ +<!doctype html> +<meta charset=utf-8> + +<script src="/resources/testharness.js"></script> +<!-- no testharnessreport.js --> +<script src="../helpers.js"></script> +<div id=log></div> +<script src="/storage-access-api/hasStorageAccess-insecure.sub.window.js"></script> diff --git a/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.https.html b/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.https.html new file mode 100644 index 0000000000..95169503c2 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/hasStorageAccess-iframe.https.html @@ -0,0 +1,8 @@ +<!doctype html> +<meta charset=utf-8> + +<script src="/resources/testharness.js"></script> +<!-- no testharnessreport.js --> +<script src="../helpers.js"></script> +<div id=log></div> +<script src="/storage-access-api/hasStorageAccess.sub.https.window.js"></script> diff --git a/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.html b/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.html new file mode 100644 index 0000000000..8b47786e17 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.html @@ -0,0 +1,10 @@ +<!doctype html> +<meta charset=utf-8> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<!-- no testharnessreport.js --> +<script src="../helpers.js"></script> +<div id=log></div> +<script src="/storage-access-api/requestStorageAccess-insecure.sub.window.js"></script> diff --git a/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.https.html b/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.https.html new file mode 100644 index 0000000000..4880464a25 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/requestStorageAccess-iframe.https.html @@ -0,0 +1,10 @@ +<!doctype html> +<meta charset=utf-8> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<!-- no testharnessreport.js --> +<script src="../helpers.js"></script> +<div id=log></div> +<script src="/storage-access-api/requestStorageAccess.sub.https.window.js"></script> diff --git a/testing/web-platform/tests/storage-access-api/resources/set-cookie.py b/testing/web-platform/tests/storage-access-api/resources/set-cookie.py new file mode 100644 index 0000000000..019697a4a8 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/set-cookie.py @@ -0,0 +1,27 @@ +def main(request, response): + name = request.GET.first(b"name") + value = request.GET.first(b"value") + testcase = request.GET.first(b"testcase") + response_headers = [(b"Set-Cookie", name + b"=" + value)] + + body = b""" + <!DOCTYPE html> + <meta charset="utf-8"> + <title>Set Storage Access Subframe</title> + <script src="/resources/testharness.js"></script> + + <script> + let querystring = window.location.search.substring(1).split("&"); + const allowed = querystring.some(param => param.toLowerCase() === "allowed=true"); + + test(() => { + if (allowed) { + assert_equals(document.cookie, "%s=%s"); + } else { + assert_equals(document.cookie, ""); + } + }, "[%s] Cookie access is allowed: " + allowed); + </script> + """ % (name, value, testcase) + + return (200, response_headers, body) |