Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created November 21, 2017 20:34
Show Gist options
  • Save bobsilverberg/02dd27122c6d87936d3e5a406ff7722e to your computer and use it in GitHub Desktop.
Save bobsilverberg/02dd27122c6d87936d3e5a406ff7722e to your computer and use it in GitHub Desktop.
add_task(async function test_exceptions() {
async function background() {
await browser.test.assertRejects(
browser.browserSettings.contextMenuShowEvent.set({value: "bad"}),
/bad is not a valid value for contextMenuShowEvent/,
"contextMenuShowEvent.set rejects with an invalid value.");
browser.test.sendMessage("done");
}
let extension = ExtensionTestUtils.loadExtension({
background,
manifest: {
permissions: ["browserSettings"],
},
useAddonManager: "temporary",
});
await promiseStartupManager();
await extension.startup();
await extension.awaitMessage("done");
await extension.unload();
await promiseShutdownManager();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment