1 description("This tests webkitStorageInfo API works."); 2 3 function errorCallback(error) 4 { 5 testFailed("Error occurred: " + error); 6 finishJSTest(); 7 } 8 9 var returnedUsage; 10 var returnedQuota; 11 function usageCallback(usage, quota) 12 { 13 returnedUsage = usage; 14 returnedQuota = quota; 15 16 // Usage should be 0 (if other storage tests have correctly cleaned up their test data before exiting). 17 shouldBe("returnedUsage", "0"); 18 19 // Quota value would vary depending on the test environment. 20 shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage"); 21 22 finishJSTest(); 23 } 24 25 if (window.webkitStorageInfo) { 26 window.jsTestIsAsync = true; 27 webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, usageCallback, errorCallback); 28 } else 29 debug("This test requires window.webkitStorageInfo."); 30 31 window.successfullyParsed = true; 32