summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js')
-rw-r--r--testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js b/testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js
new file mode 100644
index 0000000000..d6dce3675d
--- /dev/null
+++ b/testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js
@@ -0,0 +1,21 @@
+// META: title=Buckets API: Tests for bucket storage policies.
+// META: script=/storage/buckets/resources/util.js
+// META: global=window,worker
+
+'use strict';
+
+promise_test(async testCase => {
+ await prepareForBucketTest(testCase);
+
+ await promise_rejects_js(
+ testCase, TypeError,
+ navigator.storageBuckets.open('negative', {quota: -1}));
+
+ await promise_rejects_js(
+ testCase, TypeError, navigator.storageBuckets.open('zero', {quota: 0}));
+
+ await promise_rejects_js(
+ testCase, TypeError,
+ navigator.storageBuckets.open(
+ 'above_max', {quota: Number.MAX_SAFE_INTEGER + 1}));
+}, 'The open promise should reject with a TypeError when quota is requested outside the range of 1 to Number.MAX_SAFE_INTEGER.');