summaryrefslogtreecommitdiffstats
path: root/dom/quota/test/modules/content/worker/UtilsChild.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'dom/quota/test/modules/content/worker/UtilsChild.mjs')
-rw-r--r--dom/quota/test/modules/content/worker/UtilsChild.mjs22
1 files changed, 22 insertions, 0 deletions
diff --git a/dom/quota/test/modules/content/worker/UtilsChild.mjs b/dom/quota/test/modules/content/worker/UtilsChild.mjs
new file mode 100644
index 0000000000..db5757bff0
--- /dev/null
+++ b/dom/quota/test/modules/content/worker/UtilsChild.mjs
@@ -0,0 +1,22 @@
+/**
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+export const UtilsChild = {
+ async getCachedOriginUsage() {
+ postMessage({
+ moduleName: "UtilsParent",
+ objectName: "UtilsParent",
+ op: "getCachedOriginUsage",
+ });
+
+ return new Promise(function (resolve) {
+ addEventListener("message", async function onMessage(event) {
+ removeEventListener("message", onMessage);
+ const data = event.data;
+ resolve(data);
+ });
+ });
+ },
+};