3 <script src=
"../../resources/js-test.js"></script>
6 <p id=
"description"></p>
7 <div id=
"console"></div>
8 <script type=
"text/javascript">
9 description("This tests webkitStorageInfo methods do not crash when they are not given optional callbacks parameters.");
11 var testFinished
= false;
12 var numberOfExpectedCallbacks
= 0;
16 testPassed("storageInfo callback called.");
17 --numberOfExpectedCallbacks
;
21 function checkCompleted()
23 if (numberOfExpectedCallbacks
== 0 && testFinished
)
27 function isValidStorageType(type
)
29 return (type
== webkitStorageInfo
.TEMPORARY
|| type
== webkitStorageInfo
.PERSISTENT
);
32 function callStorageInfoMethodsWithFewerParameters(type
)
34 webkitStorageInfo
.requestQuota(type
, 0);
35 webkitStorageInfo
.queryUsageAndQuota(type
);
36 if (isValidStorageType(type
))
37 ++numberOfExpectedCallbacks
;
38 webkitStorageInfo
.requestQuota(type
, 0, callback
);
39 if (isValidStorageType(type
))
40 ++numberOfExpectedCallbacks
;
41 webkitStorageInfo
.queryUsageAndQuota(type
, callback
);
44 if (window
.webkitStorageInfo
) {
45 window
.jsTestIsAsync
= true;
47 // Any of the following attempts should not cause crashing.
48 callStorageInfoMethodsWithFewerParameters(webkitStorageInfo
.TEMPORARY
);
49 callStorageInfoMethodsWithFewerParameters(webkitStorageInfo
.PERSISTENT
);
50 callStorageInfoMethodsWithFewerParameters(10);
55 debug("This test requires window.webkitStorageInfo.");