Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / storage / quota / storagequota-request-persistent-quota.html
index f901102..da350db 100644 (file)
@@ -22,7 +22,8 @@ function runRequestQuotaTest() {
         usage = storageInfo.usage;
         grantedQuota = storageInfo.quota;
 
-        shouldBe("usage", "0");
+        // Quota value would vary depending on the test environment.
+        shouldBeGreaterThanOrEqual("usage", "0");
         shouldBeNonZero("grantedQuota");
 
         runNextTest();
@@ -35,11 +36,26 @@ function runRequestQuotaWithMisingArgumentTest() {
     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;
 
@@ -59,5 +75,5 @@ if (navigator.storageQuota) {
     debug("This test requires navigator.storageQuota.");
 }
 </script>
-</body
+</body>
 </html>