From 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 2 Jun 2011 12:07:03 +0100 Subject: Merge WebKit at r84325: Initial merge by git. Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b --- LayoutTests/storage/script-tests/TEMPLATE.html | 13 +++++++++ .../script-tests/storageinfo-query-usage.js | 31 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 LayoutTests/storage/script-tests/TEMPLATE.html create mode 100644 LayoutTests/storage/script-tests/storageinfo-query-usage.js (limited to 'LayoutTests/storage/script-tests') 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 @@ + + + + + + + +

+
+ + + + 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; -- cgit v1.1