media/W3C/video/events/event_progress_manual.html is a flaky failure
[WebKit-https.git] / LayoutTests / storage / storageinfo-query-usage.html
1 <html>
2 <head>
3 <script src="../resources/js-test-pre.js"></script>
4 <script src="resources/fs-test-util.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description("This tests webkitStorageInfo API works.");
11
12 function errorCallback(error)
13 {
14     testFailed("Error occurred: " + error);
15     finishJSTest();
16 }
17
18 var returnedUsage;
19 var returnedQuota;
20 function usageCallback(usage, quota)
21 {
22     returnedUsage = usage;
23     returnedQuota = quota;
24
25     // Usage should be 0 (if other storage tests have correctly cleaned up their test data before exiting).
26     shouldBe("returnedUsage", "0");
27
28     // Quota value would vary depending on the test environment.
29     shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage");
30
31     finishJSTest();
32 }
33
34 if (window.webkitStorageInfo) {
35     window.jsTestIsAsync = true;
36     webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, usageCallback, errorCallback);
37 } else
38     debug("This test requires window.webkitStorageInfo.");
39
40 window.successfullyParsed = true;
41 </script>
42 <script src="../resources/js-test-post.js"></script>
43 </body>
44 </html>