kinuko@chromium.org | 5c3424a | 2013-03-14 02:48:19 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
mark.lam@apple.com | 1ca737d | 2013-09-08 05:29:22 +0000 | [diff] [blame] | 3 | <script src="../resources/js-test-pre.js"></script> |
kinuko@chromium.org | 5c3424a | 2013-03-14 02:48:19 +0000 | [diff] [blame] | 4 | </head> |
| 5 | <body> |
| 6 | <script> |
| 7 | |
| 8 | description("This tests querying usage and quota using Quota API."); |
| 9 | |
| 10 | function errorCallback(error) |
| 11 | { |
| 12 | testFailed("Error occurred: " + error); |
| 13 | finishJSTest(); |
| 14 | } |
| 15 | |
| 16 | var returnedUsage, returnedQuota; |
| 17 | function usageCallback(usage, quota) |
| 18 | { |
| 19 | returnedUsage = usage; |
| 20 | returnedQuota = quota; |
| 21 | |
| 22 | // Usage should be 0 (if other storage tests have correctly cleaned up their test data before exiting). |
| 23 | shouldBe("returnedUsage", "0"); |
| 24 | |
| 25 | // Quota value would vary depending on the test environment. |
| 26 | shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage"); |
| 27 | |
| 28 | finishJSTest(); |
| 29 | } |
| 30 | |
| 31 | if (navigator.webkitTemporaryStorage) { |
| 32 | window.jsTestIsAsync = true; |
| 33 | navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback); |
| 34 | } |
| 35 | |
| 36 | window.successfullyParsed = true; |
| 37 | |
| 38 | </script> |
mark.lam@apple.com | 1ca737d | 2013-09-08 05:29:22 +0000 | [diff] [blame] | 39 | <script src="../resources/js-test-post.js"></script> |
kinuko@chromium.org | 5c3424a | 2013-03-14 02:48:19 +0000 | [diff] [blame] | 40 | </body> |
| 41 | </html> |