Bug 1551867 - Move appinfo init to head to avoid timing when initing enterprise policies. r=rstrong
authorMichael Kaply <mozilla@kaply.com>
Thu, 16 May 2019 23:47:13 +0000
changeset 474275 243251620b8e60ec461d348ee79a2df307655ba7
parent 474274 fc0842a0b38f664b96458910cc1a2f7faf2b9858
child 474276 03203f118c97c2ed7ad8f20f4f7733aeddb1fa4d
push id36027
push usershindli@mozilla.com
push dateFri, 17 May 2019 16:24:38 +0000
treeherdermozilla-central@c94c54aff466 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1551867
milestone68.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 1551867 - Move appinfo init to head to avoid timing when initing enterprise policies. r=rstrong Differential Revision: https://phabricator.services.mozilla.com/D31499
browser/components/enterprisepolicies/tests/xpcshell/head.js
browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js
--- a/browser/components/enterprisepolicies/tests/xpcshell/head.js
+++ b/browser/components/enterprisepolicies/tests/xpcshell/head.js
@@ -2,18 +2,26 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
+const {updateAppInfo, getAppInfo} = ChromeUtils.import("resource://testing-common/AppInfo.jsm");
 const {FileTestUtils} = ChromeUtils.import("resource://testing-common/FileTestUtils.jsm");
 
+updateAppInfo({
+  name: "XPCShell",
+  ID: "xpcshell@tests.mozilla.org",
+  version: "48",
+  platformVersion: "48",
+});
+
 // This initializes the policy engine for xpcshell tests
 let policies = Cc["@mozilla.org/enterprisepolicies;1"].getService(Ci.nsIObserver);
 policies.observe(null, "policies-startup", null);
 
 // Any changes to this function should also be made to the corresponding version
 // in browser/components/enterprisepolicies/tests/browser/head.js
 async function setupPolicyEngineWithJson(json, customSchema) {
   let filePath;
--- a/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js
+++ b/browser/components/enterprisepolicies/tests/xpcshell/test_extensionsettings.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 const {AddonTestUtils} = ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm");
 const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
 
 AddonTestUtils.init(this);
 AddonTestUtils.overrideCertDB();
-AddonTestUtils.createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "48", "48");
+AddonTestUtils.appInfo = getAppInfo();
 
 const server = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
 const BASE_URL = `http://example.com/data`;
 
 let addonID = "policytest2@mozilla.com";
 
 add_task(async function setup() {
   await AddonTestUtils.promiseStartupManager();