summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/storage/estimate-parallel.https.any.js
blob: 090f004b8514bc9c99e8f85f9e8f9073dff2a263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// META: title=StorageManager: multiple estimate() calls in parallel

promise_test(async t => {
  let r1, r2;
  await Promise.all([
    navigator.storage.estimate().then(r => { r1 = r; }),
    navigator.storage.estimate().then(r => { r2 = r; })
  ]);
  assert_true(('usage' in r1) && ('quota' in r1),
              'first response should have expected fields');
  assert_true(('usage' in r2) && ('quota' in r2),
              'second response should have expected fields');
}, 'Multiple estimate() calls in parallel should complete');