Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /storage/storagemanager-estimate.https.any.html - WPT Dashboard Interop Dashboard
- /storage/storagemanager-estimate.https.any.worker.html - WPT Dashboard Interop Dashboard
// 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');