[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.3.0esr-14.0-1] 2 commits: dropme! Bug 4234: Use the Firefox Update Process for Base Browser.

morgan (@morgan) git at gitlab.torproject.org
Thu Oct 10 21:12:22 UTC 2024



morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
39ab6faf by Pier Angelo Vendrame at 2024-10-10T20:55:41+00:00
dropme! Bug 4234: Use the Firefox Update Process for Base Browser.

This commit is not for rebase.

Revert "fixup! Bug 4234: Use the Firefox Update Process for Base Browser."

This reverts commit af856ef0e56959a57baa0056916b84e02eaf4c67.

- - - - -
25d29e14 by Pier Angelo Vendrame at 2024-10-10T20:55:41+00:00
Bug 1923264 - Discard unsupported updates in selectUpdate. r=bytesized,nalexander

UpdateService.#selectUpdate currently chooses always the most recent
update even when unsupported and an older but supported one is
available.
This commit makes #selectUpdate discard the unsupported update if a
supported alternative is found.

Differential Revision: https://phabricator.services.mozilla.com/D224905
- - - - -


3 changed files:

- toolkit/mozapps/update/tests/data/sharedUpdateXML.js
- + toolkit/mozapps/update/tests/unit_aus_update/mixedUnsupported.js
- toolkit/mozapps/update/tests/unit_aus_update/xpcshell.toml


Changes:

=====================================
toolkit/mozapps/update/tests/data/sharedUpdateXML.js
=====================================
@@ -141,6 +141,7 @@ function getRemoteUpdateString(aUpdateProps, aPatches) {
     name: "App Update Test",
     promptWaitTime: null,
     type: "major",
+    unsupported: false,
   };
 
   for (let name in aUpdateProps) {
@@ -346,6 +347,7 @@ function getUpdateString(aUpdateProps) {
       aUpdateProps.disableBackgroundUpdates +
       '" '
     : "";
+  let unsupported = aUpdateProps.unsupported ? 'unsupported="true" ' : "";
   let custom1 = aUpdateProps.custom1 ? aUpdateProps.custom1 + " " : "";
   let custom2 = aUpdateProps.custom2 ? aUpdateProps.custom2 + " " : "";
   let buildID = 'buildID="' + aUpdateProps.buildID + '"';
@@ -360,6 +362,7 @@ function getUpdateString(aUpdateProps) {
     promptWaitTime +
     disableBITS +
     disableBackgroundUpdates +
+    unsupported +
     custom1 +
     custom2 +
     buildID


=====================================
toolkit/mozapps/update/tests/unit_aus_update/mixedUnsupported.js
=====================================
@@ -0,0 +1,50 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/.
+ */
+
+/**
+ * This tests that an older update is chosen over a more recent but unsupported
+ * update.
+ */
+
+async function run_test() {
+  setupTestCommon();
+  start_httpserver();
+  setUpdateURL(gURLData + gHTTPHandlerPath);
+  setUpdateChannel("test_channel");
+
+  let patchProps = {
+    type: "complete",
+    url: "http://complete/",
+    size: "9856459",
+  };
+  let patches = getRemotePatchString(patchProps);
+  patchProps = { type: "partial", url: "http://partial/", size: "1316138" };
+  patches += getRemotePatchString(patchProps);
+
+  let oldAppVersion = "900000.0";
+  let newAppVersion = "999999.0";
+  let update1 = getRemoteUpdateString(
+    { appVersion: newAppVersion, unsupported: true },
+    patches
+  );
+  let update2 = getRemoteUpdateString({ appVersion: oldAppVersion }, patches);
+  gResponseBody = getRemoteUpdatesXMLString(update1 + update2);
+
+  let checkResult = await waitForUpdateCheck(true, { updateCount: 2 });
+  let bestUpdate = await gAUS.selectUpdate(checkResult.updates);
+  bestUpdate.QueryInterface(Ci.nsIWritablePropertyBag);
+  Assert.equal(
+    bestUpdate.unsupported,
+    false,
+    "The unsupported update has been discarded."
+  );
+  Assert.equal(
+    bestUpdate.appVersion,
+    oldAppVersion,
+    "Expected the older version to be chosen over the more recent but unsupported."
+  );
+
+  stop_httpserver(doTestFinish);
+}


=====================================
toolkit/mozapps/update/tests/unit_aus_update/xpcshell.toml
=====================================
@@ -56,6 +56,8 @@ reason = "Feature is Firefox-specific and Windows-specific."
 ["languagePackUpdates.js"]
 skip-if = ["socketprocess_networking"] # Bug 1759035
 
+["mixedUnsupported.js"]
+
 ["multiUpdate.js"]
 skip-if = ["socketprocess_networking"] # Bug 1759035
 



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/61c5f5000b9eaf0bc46c71290c466562b8c5a8f4...25d29e14296a23a9421683d27428dff78038b473

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/61c5f5000b9eaf0bc46c71290c466562b8c5a8f4...25d29e14296a23a9421683d27428dff78038b473
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20241010/44e76289/attachment-0001.htm>


More information about the tor-commits mailing list