summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/file_js_cache_cleanup.js
blob: 67986186045caf056563bad4c0417f2252a349fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict";
const { XPCOMUtils } = ChromeUtils.import(
  "resource://gre/modules/XPCOMUtils.jsm"
);

function clearCache() {
  const cacheStorageSrv = Cc[
    "@mozilla.org/netwerk/cache-storage-service;1"
  ].getService(Ci.nsICacheStorageService);
  cacheStorageSrv.clear();
}

addMessageListener("teardown", function() {
  clearCache();
  sendAsyncMessage("teardown-complete");
});