brizental pushed to branch tor-browser-158.0a1-17.0-2 at The Tor Project / Applications / Tor Browser
Commits:
-
9246f72e
by Beatriz Rizental at 2026-11-25T20:34:35+01:00
-
47930dfc
by Beatriz Rizental at 2026-11-25T20:34:35+01:00
-
f1ce3217
by Beatriz Rizental at 2026-11-25T20:34:35+01:00
5 changed files:
- browser/base/moz.build
- browser/components/cryptosafety/moz.build
- python/mozbuild/mozbuild/test/python.toml
- + python/mozbuild/mozbuild/test/test_bb_license.py
- toolkit/modules/moz.build
Changes:
| ... | ... | @@ -79,8 +79,14 @@ PERFTESTS_MANIFESTS += ["content/test/perftest.toml"] |
| 79 | 79 | DEFINES["MOZ_APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
|
| 80 | 80 | DEFINES["MOZ_APP_VERSION_DISPLAY"] = CONFIG["MOZ_APP_VERSION_DISPLAY"]
|
| 81 | 81 | |
| 82 | -# Do not include the Firefox app-license.html in about:license.
|
|
| 83 | -# tor-browser#43901.
|
|
| 82 | +GENERATED_FILES += ["license.html"]
|
|
| 83 | +GENERATED_FILES["license.html"].script = "/toolkit/content/gen_license_html.py"
|
|
| 84 | +GENERATED_FILES["license.html"].inputs = [
|
|
| 85 | + "/toolkit/content/license.html.mako",
|
|
| 86 | + "!/licenses.json",
|
|
| 87 | + # Do not include the Firefox app-license.html in about:license.
|
|
| 88 | + # tor-browser#43901.
|
|
| 89 | +]
|
|
| 84 | 90 | |
| 85 | 91 | if CONFIG["BASE_BROWSER_UPDATE"]:
|
| 86 | 92 | DEFINES["BASE_BROWSER_UPDATE"] = True
|
| ... | ... | @@ -9,3 +9,6 @@ MOZ_SRC_FILES += [ |
| 9 | 9 | "CryptoSafetyChild.sys.mjs",
|
| 10 | 10 | "CryptoSafetyParent.sys.mjs",
|
| 11 | 11 | ]
|
| 12 | + |
|
| 13 | +LICENSED_UNDER += ["mit"]
|
|
| 14 | +LICENSED_UNDER["mit"].paths = ["Bech32Decode.sys.mjs"] |
| ... | ... | @@ -109,6 +109,9 @@ subsuite = "mozbuild" |
| 109 | 109 | |
| 110 | 110 | ["test_base.py"]
|
| 111 | 111 | |
| 112 | +["test_bb_license.py"]
|
|
| 113 | +subsuite = "base-browser"
|
|
| 114 | + |
|
| 112 | 115 | ["test_confvars.py"]
|
| 113 | 116 | |
| 114 | 117 | ["test_containers.py"]
|
| 1 | +import os
|
|
| 2 | +import subprocess
|
|
| 3 | +import sys
|
|
| 4 | +import tempfile
|
|
| 5 | +import unittest
|
|
| 6 | + |
|
| 7 | +import buildconfig
|
|
| 8 | +import mozunit
|
|
| 9 | + |
|
| 10 | +# Files we add on top of Firefox that must be credited in about:license.
|
|
| 11 | +# Paths are relative to the top source directory.
|
|
| 12 | +EXPECTED_PATHS = [
|
|
| 13 | + "browser/components/cryptosafety/Bech32Decode.sys.mjs",
|
|
| 14 | + "toolkit/modules/QRCode.sys.mjs",
|
|
| 15 | +]
|
|
| 16 | + |
|
| 17 | + |
|
| 18 | +class TestAboutLicense(unittest.TestCase):
|
|
| 19 | + """Check the about:license page rendered by ./mach licenses.
|
|
| 20 | + |
|
| 21 | + Rebases onto upstream changes to how the page is generated can silently
|
|
| 22 | + drop our changes to it, since they only show up in the rendered page.
|
|
| 23 | + Requires a configured tree.
|
|
| 24 | + """
|
|
| 25 | + |
|
| 26 | + @classmethod
|
|
| 27 | + def setUpClass(cls):
|
|
| 28 | + with tempfile.TemporaryDirectory() as tmp:
|
|
| 29 | + output = os.path.join(tmp, "license.html")
|
|
| 30 | + result = subprocess.run(
|
|
| 31 | + [
|
|
| 32 | + sys.executable,
|
|
| 33 | + os.path.join(buildconfig.topsrcdir, "mach"),
|
|
| 34 | + "licenses",
|
|
| 35 | + "-o",
|
|
| 36 | + output,
|
|
| 37 | + ],
|
|
| 38 | + cwd=buildconfig.topsrcdir,
|
|
| 39 | + capture_output=True,
|
|
| 40 | + text=True,
|
|
| 41 | + check=False,
|
|
| 42 | + )
|
|
| 43 | + if result.returncode != 0:
|
|
| 44 | + raise AssertionError(
|
|
| 45 | + f"./mach licenses failed:\n{result.stdout}\n{result.stderr}"
|
|
| 46 | + )
|
|
| 47 | + with open(output, encoding="utf-8") as f:
|
|
| 48 | + cls.document = f.read()
|
|
| 49 | + |
|
| 50 | + def test_app_license_block_is_not_included(self):
|
|
| 51 | + # tor-browser#43901.
|
|
| 52 | + with open(
|
|
| 53 | + os.path.join(
|
|
| 54 | + buildconfig.topsrcdir,
|
|
| 55 | + "browser/base/content/overrides/app-license.html",
|
|
| 56 | + ),
|
|
| 57 | + encoding="utf-8",
|
|
| 58 | + ) as f:
|
|
| 59 | + block = f.read().split("-->", 1)[-1].strip()
|
|
| 60 | + self.assertTrue(block)
|
|
| 61 | + self.assertFalse(
|
|
| 62 | + block in self.document,
|
|
| 63 | + "about:license includes browser/base/content/overrides/app-license.html",
|
|
| 64 | + )
|
|
| 65 | + |
|
| 66 | + def test_expected_paths_are_credited(self):
|
|
| 67 | + for path in EXPECTED_PATHS:
|
|
| 68 | + with self.subTest(path=path):
|
|
| 69 | + self.assertTrue(
|
|
| 70 | + f"<code>{path}</code>" in self.document,
|
|
| 71 | + f"about:license does not credit {path}",
|
|
| 72 | + )
|
|
| 73 | + |
|
| 74 | + |
|
| 75 | +if __name__ == "__main__":
|
|
| 76 | + mozunit.main() |
| ... | ... | @@ -393,3 +393,6 @@ MOZ_SRC_FILES += [ |
| 393 | 393 | "PrefUtils.sys.mjs",
|
| 394 | 394 | "WebAuthnPromptHelper.sys.mjs",
|
| 395 | 395 | ]
|
| 396 | + |
|
| 397 | +LICENSED_UNDER += ["mit"]
|
|
| 398 | +LICENSED_UNDER["mit"].paths = ["QRCode.sys.mjs"] |