mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1268773 - Test addon wrapper updated in cached addon actor on reload and upgrade. r=ochameau
MozReview-Commit-ID: Fsdptohp22c --HG-- extra : rebase_source : 0ca1399280eece985b634cf700116ecdbe766894
This commit is contained in:
parent
7ce3851ef3
commit
065bec7ddc
@ -0,0 +1,10 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Test Addons Actor Upgrade",
|
||||
"version": "1.0",
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "test-addons-actor@mozilla.org"
|
||||
}
|
||||
}
|
||||
}
|
@ -67,5 +67,32 @@ add_task(function* testReloadExitedAddon() {
|
||||
const newAddonActor = yield findAddonInRootList(client, installedAddon.id);
|
||||
equal(newAddonActor.id, addonActor.id);
|
||||
|
||||
// The actor id should be the same after the reload
|
||||
equal(newAddonActor.actor, addonActor.actor);
|
||||
|
||||
const onAddonListChanged = new Promise((resolve) => {
|
||||
client.addListener("addonListChanged", function listener() {
|
||||
client.removeListener("addonListChanged", listener);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
// Install an upgrade version of the first add-on.
|
||||
const addonUpgradeFile = getSupportFile("addons/web-extension-upgrade");
|
||||
const upgradedAddon = yield AddonManager.installTemporaryAddon(
|
||||
addonUpgradeFile);
|
||||
|
||||
// Waiting for addonListChanged unsolicited event
|
||||
yield onAddonListChanged;
|
||||
|
||||
// re-list all add-ons after an upgrade.
|
||||
const upgradedAddonActor = yield findAddonInRootList(client, upgradedAddon.id);
|
||||
equal(upgradedAddonActor.id, addonActor.id);
|
||||
// The actor id should be the same after the upgrade.
|
||||
equal(upgradedAddonActor.actor, addonActor.actor);
|
||||
|
||||
// The addon metadata has been updated.
|
||||
equal(upgradedAddonActor.name, "Test Addons Actor Upgrade");
|
||||
|
||||
yield close(client);
|
||||
});
|
||||
|
@ -31,6 +31,7 @@ support-files =
|
||||
setBreakpoint-on-line-with-no-offsets.js
|
||||
setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
|
||||
addons/web-extension/manifest.json
|
||||
addons/web-extension-upgrade/manifest.json
|
||||
addons/web-extension2/manifest.json
|
||||
|
||||
[test_addon_reload.js]
|
||||
|
Loading…
Reference in New Issue
Block a user