diff options
Diffstat (limited to 'extensions/cookie/test/file_chromecommon.js')
-rw-r--r-- | extensions/cookie/test/file_chromecommon.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extensions/cookie/test/file_chromecommon.js b/extensions/cookie/test/file_chromecommon.js new file mode 100644 index 000000000..4383876b2 --- /dev/null +++ b/extensions/cookie/test/file_chromecommon.js @@ -0,0 +1,15 @@ +let { classes: Cc, utils: Cu, interfaces: Ci } = Components; + +let cs = Cc["@mozilla.org/cookiemanager;1"] + .getService(Ci.nsICookieManager2); + +addMessageListener("getCookieCountAndClear", () => { + let count = 0; + for (let list = cs.enumerator; list.hasMoreElements(); list.getNext()) + ++count; + cs.removeAll(); + + sendAsyncMessage("getCookieCountAndClear:return", { count }); +}); + +cs.removeAll(); |