forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorageinfo-query-usage.html
44 lines (37 loc) · 1.1 KB
/
storageinfo-query-usage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<html>
<head>
<script src="../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>
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;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>