blob: 6d946f1f69bfce675dec211ab952ca6a555b7b8b [file] [log] [blame]
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("This tests querying usage and quota using Quota API.");
function errorCallback(error)
{
testFailed("Error occurred: " + error);
finishJSTest();
}
var returnedUsage, returnedQuota;
function usageCallback(usage, quota)
{
returnedUsage = usage;
returnedQuota = quota;
// Usage should be 0 (if other storage tests have correctly cleaned up their test data before exiting).
shouldBe("returnedUsage", "0");
// Quota value would vary depending on the test environment.
shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage");
finishJSTest();
}
if (navigator.webkitTemporaryStorage) {
window.jsTestIsAsync = true;
navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback);
}
window.successfullyParsed = true;
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>