Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan draft
authorKris Maglione <maglione.k@gmail.com>
Tue, 22 Mar 2016 22:42:52 +0100
changeset 344202 ce5dc8d483fb367c70bbb34dc9e24e6fda530ad2
parent 344154 1438f8e8639506fe605ddcd6a4576dddb8112a06
child 516906 2ae92aa1ae5c0defca6136638e4c4f421838072c
push id13772
push usermaglione.k@gmail.com
push dateWed, 23 Mar 2016 23:47:26 +0000
reviewersaswan
bugs1258858
milestone48.0a1
Bug 1258858: Fix harmless console errors in test_webextension.js. r=aswan MozReview-Commit-ID: aDNfOANJOO
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -1737,17 +1737,16 @@ function installAllFiles(aFiles, aCallba
     });
   });
 }
 
 function promiseInstallAllFiles(aFiles, aIgnoreIncompatible) {
   let deferred = Promise.defer();
   installAllFiles(aFiles, deferred.resolve, aIgnoreIncompatible);
   return deferred.promise;
-
 }
 
 if ("nsIWindowsRegKey" in AM_Ci) {
   var MockRegistry = {
     LOCAL_MACHINE: {},
     CURRENT_USER: {},
     CLASSES_ROOT: {},
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
@@ -158,18 +158,20 @@ add_task(function*() {
 
   yield promiseRestartManager();
 });
 
 add_task(function* test_manifest_localization() {
   const ID = "webextension3@tests.mozilla.org";
 
   yield promiseInstallAllFiles([do_get_addon("webextension_3")], true);
+  yield promiseAddonStartup();
 
   let addon = yield promiseAddonByID(ID);
+  addon.userDisabled = true;
 
   equal(addon.name, "Web Extensiøn foo ☹");
   equal(addon.description, "Descriptïon bar ☹ of add-on");
 
   Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
   yield promiseRestartManager();
 
   addon = yield promiseAddonByID(ID);
@@ -179,16 +181,18 @@ add_task(function* test_manifest_localiz
 
   Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "de");
   yield promiseRestartManager();
 
   addon = yield promiseAddonByID(ID);
 
   equal(addon.name, "Web Extensiøn foo ☹");
   equal(addon.description, "Descriptïon bar ☹ of add-on");
+
+  addon.uninstall();
 });
 
 // Missing ID should cause a failure
 add_task(function*() {
   writeWebManifestForExtension({
     name: "Web Extension Name",
     version: "1.0",
     manifest_version: 2,