2 description("This tests querying usage and quota using Quota API.");
4 if (navigator.webkitTemporaryStorage) {
5 window.jsTestIsAsync = true;
6 // navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback);
9 var worker = createWorker();
11 worker.postMessage("ping");
12 worker.postMessage("eval importScripts('worker-storagequota-query-usage.js');");
13 worker.postMessage("eval requestUsage(self.port || self)");
14 worker.onmessage = function(evt) {
15 var match = /^result:(.*)/.exec(evt.data);
17 usageData = JSON.parse(match[1]);
19 // Quota value would vary depending on the test environment.
20 shouldBeGreaterThanOrEqual("usageData.usage", "0");
21 shouldBeGreaterThanOrEqual("usageData.quota", "usageData.usage");
23 worker.postMessage("close");
28 window.successfullyParsed = true;