Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'win' && socketprocess_networking && fission
- Manifest: toolkit/components/extensions/test/xpcshell/xpcshell-remote.toml includes toolkit/components/extensions/test/xpcshell/xpcshell-common.toml
- Manifest: toolkit/components/extensions/test/xpcshell/xpcshell.toml includes toolkit/components/extensions/test/xpcshell/xpcshell-common.toml
"use strict";
async function testExtensionWithBackground({
background = {},
expected_manifest_warnings,
}) {
let extension = ExtensionTestUtils.loadExtension({
manifest: { background },
});
ExtensionTestUtils.failOnSchemaWarnings(false);
await extension.startup();
ExtensionTestUtils.failOnSchemaWarnings(true);
await extension.unload();
Assert.deepEqual(
extension.extension.warnings,
expected_manifest_warnings,
"Expected manifest warnings"
);
}
add_task(async function test_empty_background_scripts() {
// extensions with an empty background.scripts property should load fine
await testExtensionWithBackground({
background: {
scripts: [],
},
expected_manifest_warnings: [
"Reading manifest: Warning processing background: background.scripts is empty.",
],
});
});