summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage/buckets/bucket-storage-policy.tentative.https.any.js
blob: d6dce3675d0bca18a379518c6ecf2c7ec1310930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.');