diff options
Diffstat (limited to 'testing/web-platform/tests/storage-access-api/resources/bless_cross_site_permissions.html')
-rw-r--r-- | testing/web-platform/tests/storage-access-api/resources/bless_cross_site_permissions.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage-access-api/resources/bless_cross_site_permissions.html b/testing/web-platform/tests/storage-access-api/resources/bless_cross_site_permissions.html new file mode 100644 index 0000000000..c3c5b6c0b0 --- /dev/null +++ b/testing/web-platform/tests/storage-access-api/resources/bless_cross_site_permissions.html @@ -0,0 +1,17 @@ +<!doctype html> +<meta charset="utf-8"> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<body> +<script> +// In order to enable `requestStorageAccess` in a third-party context for some +// origin we must first act in a window where that same origin is the top-frame +// due to the following requirements: +// (1) The origin must be `bless`ed when it's in the top-frame +// (2) `set_permission` always operates on the top-frame origin +test_driver.set_test_context(window.opener.top); +test_driver.bless("fake interaction", () => {}, window); +test_driver.set_permission({ name: 'storage-access' }, 'granted'); +window.opener.postMessage("blessed", "*"); +</script> +</body> |