Bug 1773695 - Part 6: Removing the startup cache file in the beginning of the test test_ext_webRequest_urlclassification.js. r=mixedpuppy

The patch adds a code to remove the startup cache file "webext.sc.lz4"
before running the tests in test_ext_webRequest_urlclassification.js.
This avoids the test to use an old web_request schema that is cached by
the StartupCache.

Depends on D151051

Differential Revision: https://phabricator.services.mozilla.com/D152029
This commit is contained in:
Tim Huang 2022-07-18 21:48:16 +00:00
Родитель 335b48ca92
Коммит 598545b14e
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -8,6 +8,16 @@ const { Schemas } = ChromeUtils.import("resource://gre/modules/Schemas.jsm");
* ChannelWrapper.webidl/cpp and the web_request.json schema file.
*/
add_task(async function test_webrequest_url_classification_enum() {
// The startupCache is removed whenever the buildid changes by code that runs
// during Firefox startup but not during xpcshell startup, remove it by hand
// before running this test to avoid failures with --conditioned-profile
let file = PathUtils.join(
Services.dirsvc.get("ProfLD", Ci.nsIFile).path,
"startupCache",
"webext.sc.lz4"
);
await IOUtils.remove(file, { ignoreAbsent: true });
// use normalizeManifest to get the schema loaded.
await ExtensionTestUtils.normalizeManifest({ permissions: ["webRequest"] });