From 820d795bd1ed5916a84084f5a2aaede82343ffb4 Mon Sep 17 00:00:00 2001 From: mr-cheffy <91018726+mr-cheffy@users.noreply.github.com> Date: Wed, 18 Mar 2026 22:03:07 +0000 Subject: [PATCH] chore: Sync upstream to `Firefox 149.0` --- README.md | 2 +- build/firefox-cache/l10n-last-commit-hash | 2 +- .../sandbox/browser_xdg_default.toml | 5 +- .../sandbox/browser_xdg_mozLegacyHome.toml | 5 +- .../shell/unit/test_writeShortcutIcon.js | 72 +++++++++++++++++++ .../tests/mochitests/shell/unit/xpcshell.toml | 9 +++ surfer.json | 2 +- 7 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 src/zen/tests/mochitests/shell/unit/test_writeShortcutIcon.js diff --git a/README.md b/README.md index 8482e4ec2..39b0bd086 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne ### Firefox Versions - [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `148.0.2`! 🚀 -- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 148.0.2`! +- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 149.0`! ### Contributing diff --git a/build/firefox-cache/l10n-last-commit-hash b/build/firefox-cache/l10n-last-commit-hash index 7057faa04..d845bf6e1 100644 --- a/build/firefox-cache/l10n-last-commit-hash +++ b/build/firefox-cache/l10n-last-commit-hash @@ -1 +1 @@ -7b8f3620beb1de157d972de32f9f34320f0ae189 \ No newline at end of file +c10d7dc50d4b596942cce48f8b023b831a27480a \ No newline at end of file diff --git a/src/zen/tests/mochitests/sandbox/browser_xdg_default.toml b/src/zen/tests/mochitests/sandbox/browser_xdg_default.toml index ab7d75b8c..f03f4c06f 100644 --- a/src/zen/tests/mochitests/sandbox/browser_xdg_default.toml +++ b/src/zen/tests/mochitests/sandbox/browser_xdg_default.toml @@ -3,7 +3,6 @@ [DEFAULT] skip-if = [ "ccov", - "os == 'linux' && os_version == '22.04' && arch == 'x86_64' && display == 'wayland' && asan", # bug 1784517 "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && asan", # bug 1784517 "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && tsan", # bug 1784517 ] @@ -22,4 +21,6 @@ environment = [ profile-path = "/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile" ["browser_content_sandbox_fs_xdg_default.js"] -run-if = ["os == 'linux'"] +run-if = [ + "os == 'linux'" +] diff --git a/src/zen/tests/mochitests/sandbox/browser_xdg_mozLegacyHome.toml b/src/zen/tests/mochitests/sandbox/browser_xdg_mozLegacyHome.toml index 4e30a8e33..7f7b680a8 100644 --- a/src/zen/tests/mochitests/sandbox/browser_xdg_mozLegacyHome.toml +++ b/src/zen/tests/mochitests/sandbox/browser_xdg_mozLegacyHome.toml @@ -3,7 +3,6 @@ [DEFAULT] skip-if = [ "ccov", - "os == 'linux' && os_version == '22.04' && arch == 'x86_64' && display == 'wayland' && asan", # bug 1784517 "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && asan", # bug 1784517 "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && tsan", # bug 1784517 ] @@ -25,4 +24,6 @@ environment = [ profile-path = "/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile" ["browser_content_sandbox_fs_xdg_mozLegacyHome.js"] -run-if = ["os == 'linux'"] +run-if = [ + "os == 'linux'" +] diff --git a/src/zen/tests/mochitests/shell/unit/test_writeShortcutIcon.js b/src/zen/tests/mochitests/shell/unit/test_writeShortcutIcon.js new file mode 100644 index 000000000..8a05114b3 --- /dev/null +++ b/src/zen/tests/mochitests/shell/unit/test_writeShortcutIcon.js @@ -0,0 +1,72 @@ +/* Any copyright is dedicated to the Public Domain. + * https://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +ChromeUtils.defineESModuleGetters(this, { + FileTestUtils: "resource://testing-common/FileTestUtils.sys.mjs", + ShellService: "moz-src:///browser/components/shell/ShellService.sys.mjs", + XPCOMUtils: "resource://gre/modules/XPCOMUtils.sys.mjs", +}); + +XPCOMUtils.defineLazyServiceGetters(this, { + imgTools: ["@mozilla.org/image/tools;1", Ci.imgITools], +}); + +let gPngImage; +let gSvgImage; + +add_setup(async function loadImages() { + let pngFile = do_get_file("favicon-normal16.png"); + gPngImage = imgTools.decodeImageFromArrayBuffer( + (await IOUtils.read(pngFile.path)).buffer, + "image/png" + ); + + let svgFile = do_get_file("icon.svg"); + let svgUri = Services.io.newFileURI(svgFile); + let svgChannel = Services.io.newChannelFromURI( + svgUri, + null, + Services.scriptSecurityManager.getSystemPrincipal(), + null, + Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL, + Ci.nsIContentPolicy.TYPE_IMAGE + ); + gSvgImage = await ChromeUtils.fetchDecodedImage(svgUri, svgChannel); +}); + +/** + * Ensures that the file is an ICO file with the correct dimensions. + * + * Currently, this doesn't actually check the file's image data, since that's + * (a) difficult to do from JavaScript for raster files (especially given the + * scaling) and (b) not easy in general for vector files without just rewriting + * createWindowsIcon inline. + * + * @param {nsIFile} file - The file containing the image. + */ +async function verifyOutput(file) { + let image = imgTools.decodeImageFromArrayBuffer( + (await IOUtils.read(file.path)).buffer, + "image/vnd.microsoft.icon" + ); + + ok(image, "Image decoded successfully from its native format"); + Assert.equal(image.width, 256, "Image is 256 pixels wide"); + Assert.equal(image.height, 256, "Image is 256 pixels tall"); +} + +add_task(async function test_iconDimensions_raster() { + let tempFile = FileTestUtils.getTempFile(); + await ShellService.createWindowsIcon(tempFile, gPngImage); + await verifyOutput(tempFile); + await IOUtils.remove(tempFile.path); +}); + +add_task(async function test_iconDimensions_vector() { + let tempFile = FileTestUtils.getTempFile(); + await ShellService.createWindowsIcon(tempFile, gSvgImage); + await verifyOutput(tempFile); + await IOUtils.remove(tempFile.path); +}); diff --git a/src/zen/tests/mochitests/shell/unit/xpcshell.toml b/src/zen/tests/mochitests/shell/unit/xpcshell.toml index 563a940e2..8f339f132 100644 --- a/src/zen/tests/mochitests/shell/unit/xpcshell.toml +++ b/src/zen/tests/mochitests/shell/unit/xpcshell.toml @@ -9,3 +9,12 @@ tags = "os_integration" run-if = [ "os == 'mac'", ] + +["test_writeShortcutIcon.js"] +run-if = [ + "os == 'win'", +] +support-files = [ + "../../../places/tests/browser/favicon-normal16.png", + "../../../../base/content/test/favicons/icon.svg", +] diff --git a/surfer.json b/surfer.json index 71695cd09..28bc5aec7 100644 --- a/surfer.json +++ b/surfer.json @@ -6,7 +6,7 @@ "version": { "product": "firefox", "version": "148.0.2", - "candidate": "148.0.2", + "candidate": "149.0", "candidateBuild": 1 }, "buildOptions": {