1description("This tests webkitStorageInfo API works."); 2 3function errorCallback(error) 4{ 5 testFailed("Error occurred: " + error); 6 finishJSTest(); 7} 8 9var returnedUsage; 10var returnedQuota; 11function 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 25if (window.webkitStorageInfo) { 26 window.jsTestIsAsync = true; 27 webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, usageCallback, errorCallback); 28} else 29 debug("This test requires window.webkitStorageInfo."); 30 31window.successfullyParsed = true; 32