summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /LayoutTests/storage
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'LayoutTests/storage')
-rw-r--r--LayoutTests/storage/script-tests/TEMPLATE.html13
-rw-r--r--LayoutTests/storage/script-tests/storageinfo-query-usage.js31
-rw-r--r--LayoutTests/storage/storageinfo-query-usage-expected.txt11
-rw-r--r--LayoutTests/storage/storageinfo-query-usage.html13
4 files changed, 68 insertions, 0 deletions
diff --git a/LayoutTests/storage/script-tests/TEMPLATE.html b/LayoutTests/storage/script-tests/TEMPLATE.html
new file mode 100644
index 0000000..eb1d038
--- /dev/null
+++ b/LayoutTests/storage/script-tests/TEMPLATE.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+<script src="resources/fs-test-util.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="YOUR_JS_FILE_HERE"></script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/script-tests/storageinfo-query-usage.js b/LayoutTests/storage/script-tests/storageinfo-query-usage.js
new file mode 100644
index 0000000..8af9232
--- /dev/null
+++ b/LayoutTests/storage/script-tests/storageinfo-query-usage.js
@@ -0,0 +1,31 @@
+description("This tests webkitStorageInfo API works.");
+
+function errorCallback(error)
+{
+ testFailed("Error occurred: " + error);
+ finishJSTest();
+}
+
+var returnedUsage;
+var 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 (window.webkitStorageInfo) {
+ window.jsTestIsAsync = true;
+ webkitStorageInfo.queryUsageAndQuota(webkitStorageInfo.TEMPORARY, usageCallback, errorCallback);
+} else
+ debug("This test requires window.webkitStorageInfo.");
+
+window.successfullyParsed = true;
diff --git a/LayoutTests/storage/storageinfo-query-usage-expected.txt b/LayoutTests/storage/storageinfo-query-usage-expected.txt
new file mode 100644
index 0000000..50ef9e6
--- /dev/null
+++ b/LayoutTests/storage/storageinfo-query-usage-expected.txt
@@ -0,0 +1,11 @@
+This tests webkitStorageInfo API works.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS returnedUsage is 0
+PASS returnedQuota is >= returnedUsage
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/storageinfo-query-usage.html b/LayoutTests/storage/storageinfo-query-usage.html
new file mode 100644
index 0000000..6e41d42
--- /dev/null
+++ b/LayoutTests/storage/storageinfo-query-usage.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script src="../fast/js/resources/js-test-pre.js"></script>
+<script src="resources/fs-test-util.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/storageinfo-query-usage.js"></script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>