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:
Luca Greco 2016-07-07 14:55:31 +02:00
parent 7ce3851ef3
commit 065bec7ddc
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,10 @@
{
"manifest_version": 2,
"name": "Test Addons Actor Upgrade",
"version": "1.0",
"applications": {
"gecko": {
"id": "test-addons-actor@mozilla.org"
}
}
}

View File

@ -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);
});

View File

@ -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]