summaryrefslogtreecommitdiffstats
path: root/netwerk/test/mochitests/file_chromecommon.js
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/test/mochitests/file_chromecommon.js')
-rw-r--r--netwerk/test/mochitests/file_chromecommon.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/netwerk/test/mochitests/file_chromecommon.js b/netwerk/test/mochitests/file_chromecommon.js
new file mode 100644
index 0000000000..986a9d7ef1
--- /dev/null
+++ b/netwerk/test/mochitests/file_chromecommon.js
@@ -0,0 +1,15 @@
+/* eslint-env mozilla/chrome-script */
+
+"use strict";
+
+// eslint-disable-next-line mozilla/use-services
+let cs = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
+
+addMessageListener("getCookieCountAndClear", () => {
+ let count = cs.cookies.length;
+ cs.removeAll();
+
+ sendAsyncMessage("getCookieCountAndClear:return", { count });
+});
+
+cs.removeAll();