This patch contains a proposed approach for the longer term fix we agreed on (see Bug 1746841 comment 10 and comment 11) and replace the mochitest-browser added in the other patch attached to this bug with an xpcshell test (which besides covering the same base scenario that mochitest-browser was convering, it is also lighter and covers also other cases that were not explicitly covered yet). - added also an image to the test extension to explicitly verify the image caching behavior is also covered and works as expected - added a test case to verify that cache images aren't cleared when the addon is permanently installed and it is not starting for an upgrade/downgrade Differential Revision: https://phabricator.services.mozilla.com/D134508