зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1733871 - Allow tests to use `computeHash` from ProductAddonChecker.jsm. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D127387
This commit is contained in:
Родитель
7c9176e7d2
Коммит
a28c02848c
|
@ -4,9 +4,8 @@ const { AddonTestUtils } = ChromeUtils.import(
|
||||||
"resource://testing-common/AddonTestUtils.jsm"
|
"resource://testing-common/AddonTestUtils.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
const { computeHash } = ChromeUtils.import(
|
const { ProductAddonChecker } = ChromeUtils.import(
|
||||||
"resource://gre/modules/addons/ProductAddonChecker.jsm",
|
"resource://gre/modules/addons/ProductAddonChecker.jsm"
|
||||||
null
|
|
||||||
);
|
);
|
||||||
|
|
||||||
AddonTestUtils.initMochitest(this);
|
AddonTestUtils.initMochitest(this);
|
||||||
|
@ -70,7 +69,10 @@ add_task(async function test_management_install() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let themeXPIFileHash = await computeHash("sha256", themeXPIFile.path);
|
let themeXPIFileHash = await ProductAddonChecker.computeHash(
|
||||||
|
"sha256",
|
||||||
|
themeXPIFile.path
|
||||||
|
);
|
||||||
|
|
||||||
const otherXPIFile = AddonTestUtils.createTempWebExtensionFile({
|
const otherXPIFile = AddonTestUtils.createTempWebExtensionFile({
|
||||||
manifest: {
|
manifest: {
|
||||||
|
|
|
@ -398,4 +398,7 @@ const ProductAddonChecker = {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// For test use only.
|
||||||
|
computeHash,
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче