storagemanager-estimate.https.any.js (625B)
1 // META: title=StorageManager: estimate() 2 3 test(t => { 4 assert_true('estimate' in navigator.storage); 5 assert_equals(typeof navigator.storage.estimate, 'function'); 6 assert_true(navigator.storage.estimate() instanceof Promise); 7 }, 'estimate() method exists and returns a Promise'); 8 9 promise_test(async t => { 10 const result = await navigator.storage.estimate(); 11 assert_equals(typeof result, 'object'); 12 assert_true('usage' in result); 13 assert_equals(typeof result.usage, 'number'); 14 assert_true('quota' in result); 15 assert_equals(typeof result.quota, 'number'); 16 }, 'estimate() resolves to dictionary with members');