Closed Bug 2024620 Opened 5 months ago Closed 5 months ago

test_ext_contentscript_csp.js should clear all subresource cache for each subtest

Categories

(WebExtensions :: General, task)

task

Tracking

(firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Now that CSS are cached in-memory, and bug 1670403 is going to add in-memory cache for JS, the WebExtensions testcase should clear all those cache for each tests, to isolate the environment.
Currently the clearCache function clears the necko cache2 cache and the image cache.
It should also call ChromeUtils.clearResourceCache.

https://searchfox.org/firefox-main/rev/fa20ce29b1a82b717b7ff6863af8c12b381b3ec5/toolkit/components/extensions/test/xpcshell/head.js#162-169

function clearCache() {
  Services.cache2.clear();

  let imageCache = Cc["@mozilla.org/image/tools;1"]
    .getService(Ci.imgITools)
    .getImgCacheForDocument(null);
  imageCache.clearCache(false);
}
Pushed by arai_a@mac.com: https://github.com/mozilla-firefox/firefox/commit/59927549ddf6 https://hg.mozilla.org/integration/autoland/rev/c0aa85bd6087 Clear all subresource cache in WebExtensions tests. r=extension-reviewers,robwu
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: