Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / quota / storageinfo-query-usage.html
blob88a489b4b95070d5f3fc87283dc59ee2fe917d92
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p id="description"></p>
7 <div id="console"></div>
8 <script type="text/javascript">
9 description("This tests webkitStorageInfo API works.");
11 function errorCallback(error)
13 testFailed("Error occurred: " + error);
14 finishJSTest();
17 var returnedUsage;
18 var returnedQuota;
19 function usageCallback(usage, quota)
21 returnedUsage = usage;
22 returnedQuota = quota;
24 // Quota value would vary depending on the test environment.
25 shouldBeGreaterThanOrEqual("returnedUsage", "0");
26 shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage");
28 finishJSTest();
31 if (window.webkitStorageInfo) {
32 window.jsTestIsAsync = true;
33 webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, usageCallback, errorCallback);
34 } else {
35 debug("This test requires window.webkitStorageInfo.");
37 </script>
38 </body>
39 </html>