Bug 1287007 - Fix test_ext_management_uninstall_self.js r=bsilverberg

The test logic was broken by design: Two tests uninstall the addon,
but only one uninstall observer was used. Consequently, the second
test resumes the test before the addon was actually uninstalled.

It is probably sheer luck that the test worked before.

MozReview-Commit-ID: DcT48ZQ2bRp

--HG--
extra : rebase_source : 6ab304eab2c306106b5383726fbdf73775c5060a
This commit is contained in:
Rob Wu 2016-09-13 13:59:37 -07:00
Родитель ec11370338
Коммит f81e1a59a2
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -19,7 +19,7 @@ const manifest = {
version: "1.0",
};
const waitForUninstalled = new Promise(resolve => {
const waitForUninstalled = () => new Promise(resolve => {
const listener = {
onUninstalled: (addon) => {
equal(addon.id, id, "The expected add-on has been uninstalled");
@ -67,7 +67,7 @@ add_task(function* test_management_uninstall_no_prompt() {
let addon = yield promiseAddonByID(id);
notEqual(addon, null, "Add-on is installed");
extension.sendMessage("uninstall");
yield waitForUninstalled;
yield waitForUninstalled();
yield extension.markUnloaded();
Services.obs.notifyObservers(extension.extension.file, "flush-cache-entry", null);
});
@ -91,7 +91,7 @@ add_task(function* test_management_uninstall_prompt_uninstall() {
let addon = yield promiseAddonByID(id);
notEqual(addon, null, "Add-on is installed");
extension.sendMessage("uninstall");
yield waitForUninstalled;
yield waitForUninstalled();
yield extension.markUnloaded();
// Test localization strings