fune/browser/components/ssb/tests/xpcshell/test_uninstall.js
Dave Townsend 29625e4aba Bug 1602186: Allow installing SSBs and launching them from the command line. r=Gijs
Allows for persisting SSBs to storage for realoading in a later app instance.
Also adds a command line argument to load and open an SSB based on its ID.

Differential Revision: https://phabricator.services.mozilla.com/D56289

--HG--
extra : moz-landing-system : lando
2019-12-16 19:49:12 +00:00

31 lines
835 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that uninstalling removes from the store.
add_task(async () => {
let kvstore = await getKVStore();
kvstore.put(
"_meta",
JSON.stringify({
version: 1,
})
);
storeSSB(kvstore, "a", parseManifest("https://www.mozilla.org/"), {});
let ssb = await SiteSpecificBrowser.load("a");
let ssbs = await SiteSpecificBrowserService.list();
Assert.equal(ssbs.length, 1);
Assert.equal(ssbs[0], ssb);
Assert.ok(ssb.canLoad(uri("https://www.mozilla.org/test/")));
Assert.ok(!ssb.canLoad(uri("https://www.microsoft.com/test/")));
await ssb.uninstall();
ssbs = await SiteSpecificBrowserService.list();
Assert.equal(ssbs.length, 0);
Assert.ok(!(await kvstore.has(storeKey("a"))));
});