Bug 1454202: Follow-up: Fix Marionette test bustage. r=bustage,test-only
authorKris Maglione <maglione.k@gmail.com>
Sat, 21 Apr 2018 18:32:00 -0700
changeset 468501 6794d2faf47c71da2f28e299e596b3f9808f490f
parent 468500 aa51d5460d2815b8794ba244dcf279632c8fce22
child 468502 df38004081b38e5b657d51878dc8b534e67ec08b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage, test-only
bugs1454202
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1454202: Follow-up: Fix Marionette test bustage. r=bustage,test-only MozReview-Commit-ID: 5iWc4ta8TOg
testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_addons.py
@@ -26,34 +26,33 @@ class TestAddons(MarionetteTestCase):
 
         super(TestAddons, self).tearDown()
 
     @property
     def all_addon_ids(self):
         with self.marionette.using_context("chrome"):
             addons = self.marionette.execute_async_script("""
               Components.utils.import("resource://gre/modules/AddonManager.jsm");
-              AddonManager.getAllAddons(function(addons) {
+              AddonManager.getAllAddons().then(function(addons) {
                 let ids = addons.map(x => x.id);
                 marionetteScriptFinished(ids);
               });
             """)
 
         return set(addons)
 
     def reset_addons(self):
         with self.marionette.using_context("chrome"):
             for addon in (self.all_addon_ids - self.preinstalled_addons):
                 addon_id = self.marionette.execute_async_script("""
                   Components.utils.import("resource://gre/modules/AddonManager.jsm");
-                  return new Promise(resolve => {
-                    AddonManager.getAddonByID(arguments[0], function(addon) {
-                      addon.uninstall();
-                      marionetteScriptFinished(addon.id);
-                    });
+                  return new Promise(await resolve => {
+                    let addon = await AddonManager.getAddonByID(arguments[0]);
+                    addon.uninstall();
+                    marionetteScriptFinished(addon.id);
                   });
                 """, script_args=(addon,))
                 self.assertEqual(addon_id, addon,
                                  msg="Failed to uninstall {}".format(addon))
 
     def test_temporary_install_and_remove_unsigned_addon(self):
         addon_path = os.path.join(here, "webextension-unsigned.xpi")