1
0
Fork 0
firefox/testing/web-platform/tests/storage/storagemanager-estimate.https.any.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

16 lines
625 B
JavaScript

// META: title=StorageManager: estimate()
test(t => {
assert_true('estimate' in navigator.storage);
assert_equals(typeof navigator.storage.estimate, 'function');
assert_true(navigator.storage.estimate() instanceof Promise);
}, 'estimate() method exists and returns a Promise');
promise_test(async t => {
const result = await navigator.storage.estimate();
assert_equals(typeof result, 'object');
assert_true('usage' in result);
assert_equals(typeof result.usage, 'number');
assert_true('quota' in result);
assert_equals(typeof result.quota, 'number');
}, 'estimate() resolves to dictionary with members');