Bug 1549075 Follow-up Fix loading built in manifests r=zombie a=pascalc CLOSED TREE
authorAndrew Swan <aswan@mozilla.com>
Sun, 05 May 2019 09:04:47 -0700
changeset 472598 e5ed24b52564b6a41fd6a4eadde8e8832c4b91c1
parent 472597 7620ecc6c5349a3808aa915757dd5c36421d8433
child 472599 7aae4f23a5a189ffda85ab44342669b235c91c38
push id113027
push userccoroiu@mozilla.com
push dateSun, 05 May 2019 21:45:51 +0000
treeherdermozilla-inbound@1e3244e602fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszombie, pascalc
bugs1549075
milestone68.0a1
first release with
nightly linux32
e5ed24b52564 / 68.0a1 / 20190505170022 / files
nightly linux64
e5ed24b52564 / 68.0a1 / 20190505170022 / files
nightly mac
e5ed24b52564 / 68.0a1 / 20190505170022 / files
nightly win32
e5ed24b52564 / 68.0a1 / 20190505170022 / files
nightly win64
e5ed24b52564 / 68.0a1 / 20190505170022 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549075 Follow-up Fix loading built in manifests r=zombie a=pascalc CLOSED TREE Differential Revision: https://phabricator.services.mozilla.com/D29963
toolkit/mozapps/extensions/internal/XPIInstall.jsm
toolkit/mozapps/extensions/test/xpcshell/test_builtin_location.js
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -637,17 +637,17 @@ var loadManifestFromFile = async functio
 };
 
 /*
  * A synchronous method for loading an add-on's manifest. Do not use
  * this.
  */
 function syncLoadManifest(state, location, oldAddon) {
   if (location.name == "app-builtin") {
-    let pkg = builtinPackage(Services.io.newURI(oldAddon.rootURI));
+    let pkg = builtinPackage(Services.io.newURI(state.rootURI));
     return XPIInternal.awaitPromise(loadManifest(pkg, location, oldAddon));
   }
 
   let file = new nsIFile(state.path);
   let pkg = Package.get(file);
   return XPIInternal.awaitPromise((async () => {
     try {
       let addon = await loadManifest(pkg, location, oldAddon);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_builtin_location.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_builtin_location.js
@@ -48,16 +48,29 @@ add_task(async function test_builtin_loc
   await wrapper.awaitStartup();
   await wrapper.awaitMessage("started");
   ok(true, "Extension in built-in location ran after restart");
 
   addon = await promiseAddonByID(id);
   notEqual(addon, null, "Addon is installed");
   ok(addon.isActive, "Addon is active");
 
+  // After a restart that changes the schema version, it should still work
+  await promiseShutdownManager();
+  Services.prefs.setIntPref("extensions.databaseSchema", 0);
+  await promiseStartupManager();
+
+  await wrapper.awaitStartup();
+  await wrapper.awaitMessage("started");
+  ok(true, "Extension in built-in location ran after restart");
+
+  addon = await promiseAddonByID(id);
+  notEqual(addon, null, "Addon is installed");
+  ok(addon.isActive, "Addon is active");
+
   await wrapper.unload();
 
   addon = await promiseAddonByID(id);
   equal(addon, null, "Addon is gone after uninstall");
   await AddonTestUtils.promiseShutdownManager();
 });
 
 // Tests installing a hidden extension from the built-in location.