Bug 1449630 - Move promise init before policy to fix intermittent. r=Felipe
authorMichael Kaply <mozilla@kaply.com>
Fri, 30 Mar 2018 12:10:19 -0500
changeset 410787 cd453722f1348ba3a33512d9e1eaca65ba7fe876
parent 410786 bf285f58e643f3f283fcfe0c53c419dae49709f0
child 410788 18a14e2a17c6fb9d76355a665453bfcb2e08f1d2
push id33739
push usernbeleuzu@mozilla.com
push dateFri, 30 Mar 2018 21:47:45 +0000
treeherdermozilla-central@10c662d8416e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1449630
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 1449630 - Move promise init before policy to fix intermittent. r=Felipe MozReview-Commit-ID: 7GDUzGfb7DS
browser/components/enterprisepolicies/tests/browser/browser_policy_extensions.js
--- a/browser/components/enterprisepolicies/tests/browser/browser_policy_extensions.js
+++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_extensions.js
@@ -1,28 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 const addonID = "policytest@mozilla.com";
 
 add_task(async function test_addon_install() {
+  let installPromise = wait_for_addon_install();
   await setupPolicyEngineWithJson({
     "policies": {
       "Extensions": {
         "Install": [
           "http://mochi.test:8888/browser/browser/components/enterprisepolicies/tests/browser/policytest.xpi"
         ],
         "Locked": [
           addonID
         ]
       }
     }
   });
-  await wait_for_addon_install();
+  await installPromise;
   let addon = await AddonManager.getAddonByID(addonID);
   isnot(addon, null, "Addon not installed.");
 });
 
 add_task(async function test_addon_locked() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
   await BrowserOpenAddonsMgr("addons://list/extension");
   // eslint-disable-next-line no-shadow