summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js')
-rw-r--r--testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js b/testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js
new file mode 100644
index 0000000000..b3aa19c25c
--- /dev/null
+++ b/testing/web-platform/tests/storage-access-api/requestStorageAccess-non-fully-active.sub.https.window.js
@@ -0,0 +1,18 @@
+// META: script=helpers.js
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
+'use strict';
+
+promise_test(t => {
+ const promise = RunRequestStorageAccessInDetachedFrame();
+ const description = "document.requestStorageAccess() call in a detached frame";
+ // Can't use `promise_rejects_dom` here, since the error comes from the wrong global.
+ return promise.then(t.unreached_func("Should have rejected: " + description), (e) => {
+ assert_equals(e.name, 'InvalidStateError', description);
+ });
+}, "[non-fully-active] document.requestStorageAccess() should not resolve when run in a detached frame");
+
+promise_test(t => {
+ return promise_rejects_dom(t, 'InvalidStateError', RunRequestStorageAccessViaDomParser(),
+ "document.requestStorageAccess() in a detached DOMParser result");
+}, "[non-fully-active] document.requestStorageAccess() should not resolve when run in a detached DOMParser document");