blob: b06f8ed98a4d7a49d28e79774b3176f7551fe825 [file] [log] [blame]
kinuko@chromium.org5c3424a2013-03-14 02:48:19 +00001<html>
2<head>
mark.lam@apple.com1ca737d2013-09-08 05:29:22 +00003<script src="../resources/js-test-pre.js"></script>
kinuko@chromium.org5c3424a2013-03-14 02:48:19 +00004</head>
5<body>
6<script>
7
8description("This tests querying usage and quota using Quota API.");
9
10function errorCallback(error)
11{
12 testFailed("Error occurred: " + error);
13 finishJSTest();
14}
15
16var returnedUsage, returnedQuota;
17function 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
31if (navigator.webkitTemporaryStorage) {
32 window.jsTestIsAsync = true;
33 navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback);
34}
35
36window.successfullyParsed = true;
37
38</script>
mark.lam@apple.com1ca737d2013-09-08 05:29:22 +000039<script src="../resources/js-test-post.js"></script>
kinuko@chromium.org5c3424a2013-03-14 02:48:19 +000040</body>
41</html>