| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>StorageManager: estimate()</title> | 2 <title>StorageManager: estimate()</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/testharness-helpers.js"></script> | |
| 6 <script> | 5 <script> |
| 7 | 6 |
| 8 test(function(t) { | 7 test(function(t) { |
| 9 assert_true('estimate' in window.navigator.storage); | 8 assert_true('estimate' in window.navigator.storage); |
| 10 assert_equals(typeof window.navigator.storage.estimate, 'function'); | 9 assert_equals(typeof window.navigator.storage.estimate, 'function'); |
| 11 assert_true(window.navigator.storage.estimate() instanceof Promise); | 10 assert_true(window.navigator.storage.estimate() instanceof Promise); |
| 12 }, 'estimate() method exists and returns a Promise'); | 11 }, 'estimate() method exists and returns a Promise'); |
| 13 | 12 |
| 14 promise_test(function(t) { | 13 promise_test(function(t) { |
| 15 return window.navigator.storage.estimate().then(function(result) { | 14 return window.navigator.storage.estimate().then(function(result) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // the data or pre-allocate blocks larger than the value being store
d. | 72 // the data or pre-allocate blocks larger than the value being store
d. |
| 74 assert_greater_than_equal(after - before, large_value.length, | 73 assert_greater_than_equal(after - before, large_value.length, |
| 75 'increase should be at least as large as value stored'); | 74 'increase should be at least as large as value stored'); |
| 76 | 75 |
| 77 db.close(); | 76 db.close(); |
| 78 return deleteDB(name); | 77 return deleteDB(name); |
| 79 }); | 78 }); |
| 80 }, 'estimate() shows usage increase after large value is stored'); | 79 }, 'estimate() shows usage increase after large value is stored'); |
| 81 | 80 |
| 82 </script> | 81 </script> |
| OLD | NEW |