Unexpected constructor / instanceof behavior when retrieving indexedDB data in an...
[WebKit-https.git] / LayoutTests / storage / storagequota-query-usage.html
1 <html>
2 <head>
3 <script src="../resources/js-test-pre.js"></script>
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>
39 <script src="../resources/js-test-post.js"></script>
40 </body>
41 </html>