usage = storageInfo.usage;
grantedQuota = storageInfo.quota;
- shouldBe("usage", "0");
+ // Quota value would vary depending on the test environment.
+ shouldBeGreaterThanOrEqual("usage", "0");
shouldBeNonZero("grantedQuota");
runNextTest();
runNextTest();
}
+function runRequestQuotaWithNegativeValueTest() {
+ debug("* Requesting persistent quota with negative value.");
+ navigator.storageQuota.requestPersistentQuota(-1024).then(function(storageInfo) {
+ usage = storageInfo.usage;
+ grantedQuota = storageInfo.quota;
+
+ // Quota value would vary depending on the test environment.
+ shouldBeGreaterThanOrEqual("usage", "0");
+ shouldBeZero("grantedQuota");
+
+ runNextTest();
+ }, onrejected);
+}
+
// End of test body functions ---------------------------------------------
var testsList = [
runRequestQuotaTest,
runRequestQuotaWithMisingArgumentTest,
+ runRequestQuotaWithNegativeValueTest,
];
var testCounter = 0;
debug("This test requires navigator.storageQuota.");
}
</script>
-</body
+</body>
</html>