Skip to content

Commit 4046dd0

Browse files
authored
chore: Sync upstream to Firefox 147.0.2, p=#12067
1 parent e515928 commit 4046dd0

File tree

10 files changed

+217
-191
lines changed

10 files changed

+217
-191
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
3535
### Firefox Versions
3636

3737
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `147.0.1`! 🚀
38-
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.1`!
38+
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 147.0.2`!
3939

4040
### Contributing
4141

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
783b222b1b93fb9e8c52eb57558ef7f07bca6e7e
1+
0bb7af8f277a229203f46cbba04b9ac7890c52ba

src/zen/tests/mochitests/sandbox/browser_content_sandbox_fs_tests.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@ async function testFileAccessWindowsOnly() {
682682
let tests = [];
683683

684684
let extDir = GetPerUserExtensionDir();
685+
// We used to unconditionally create this directory from Firefox, but that
686+
// was dropped in bug 2001887. The value of this directory is questionable;
687+
// the test was added in Firefox 56 (bug 1403744) to cover legacy add-ons,
688+
// but legacy add-on support was discontinued in Firefox 57, and we stopped
689+
// sideloading add-ons from this directory on all builds except ESR in
690+
// Firefox 74 (bug 1602840).
691+
await IOUtils.makeDirectory(extDir.path);
685692
tests.push({
686693
desc: "per-user extensions dir",
687694
ok: true,

src/zen/tests/mochitests/sandbox/browser_content_sandbox_fs_xdg_xdgConfigHome.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ add_setup(async function setup() {
2222
const xdgConfigHome = Services.env.get("XDG_CONFIG_HOME");
2323
Assert.greater(xdgConfigHome.length, 1, "XDG_CONFIG_HOME is defined");
2424

25+
// Verify the profile directory is inside XDG_CONFIG_HOME
26+
const profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
27+
Assert.ok(
28+
profileDir.path.startsWith(xdgConfigHome),
29+
`Profile directory (${profileDir.path}) should be inside XDG_CONFIG_HOME (${xdgConfigHome})`
30+
);
31+
2532
// If it is there, do actual testing
2633
sanityChecks();
2734
});

src/zen/tests/mochitests/sandbox/browser_xdg_default.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ support-files = [
1212
"browser_content_sandbox_utils.js",
1313
"browser_content_sandbox_fs_tests.js",
1414
]
15-
# .config needs to exists for the sandbox to properly add it
16-
test-directories = ["/tmp/.xdg_default_test", "/tmp/.xdg_default_test/.config"]
15+
test-directories = [
16+
"/tmp/.xdg_default_test",
17+
"/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile",
18+
]
1719
environment = [
1820
"HOME=/tmp/.xdg_default_test",
1921
]
22+
profile-path = "/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile"
2023

2124
["browser_content_sandbox_fs_xdg_default.js"]
2225
run-if = ["os == 'linux'"]

src/zen/tests/mochitests/sandbox/browser_xdg_mozLegacyHome.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ support-files = [
1212
"browser_content_sandbox_utils.js",
1313
"browser_content_sandbox_fs_tests.js",
1414
]
15-
test-directories = ["/tmp/.xdg_mozLegacyHome_test/.config", "/tmp/.xdg_config_home_test"]
15+
test-directories = [
16+
"/tmp/.xdg_mozLegacyHome_test/.config",
17+
"/tmp/.xdg_config_home_test",
18+
"/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile",
19+
]
1620
environment = [
1721
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
1822
"HOME=/tmp/.xdg_mozLegacyHome_test",
1923
"MOZ_LEGACY_HOME=1",
2024
]
25+
profile-path = "/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile"
2126

2227
["browser_content_sandbox_fs_xdg_mozLegacyHome.js"]
2328
run-if = ["os == 'linux'"]

src/zen/tests/mochitests/sandbox/browser_xdg_xdgConfigHome.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ support-files = [
1111
"browser_content_sandbox_utils.js",
1212
"browser_content_sandbox_fs_tests.js",
1313
]
14-
test-directories = "/tmp/.xdg_config_home_test"
14+
test-directories = [
15+
"/tmp/.xdg_config_home_test",
16+
"/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile",
17+
]
1518
environment = [
1619
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
1720
"MOZ_LEGACY_HOME=0",
1821
]
22+
profile-path = "/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile"
1923

2024
["browser_content_sandbox_fs_xdg_xdgConfigHome.js"]
2125
run-if = [

src/zen/tests/mochitests/sandbox/mac_register_font.py

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,69 +17,69 @@
1717

1818

1919
def main():
20-
parser = argparse.ArgumentParser()
21-
parser.add_argument(
22-
"-v",
23-
"--verbose",
24-
action="store_true",
25-
help="print verbose registration failures",
26-
default=False,
27-
)
28-
parser.add_argument(
29-
"file", nargs="*", help="font file to register or unregister", default=[]
30-
)
31-
parser.add_argument(
32-
"-u",
33-
"--unregister",
34-
action="store_true",
35-
help="unregister the provided fonts",
36-
default=False,
37-
)
38-
parser.add_argument(
39-
"-p",
40-
"--persist-user",
41-
action="store_true",
42-
help="permanently register the font",
43-
default=False,
44-
)
20+
parser = argparse.ArgumentParser()
21+
parser.add_argument(
22+
"-v",
23+
"--verbose",
24+
action="store_true",
25+
help="print verbose registration failures",
26+
default=False,
27+
)
28+
parser.add_argument(
29+
"file", nargs="*", help="font file to register or unregister", default=[]
30+
)
31+
parser.add_argument(
32+
"-u",
33+
"--unregister",
34+
action="store_true",
35+
help="unregister the provided fonts",
36+
default=False,
37+
)
38+
parser.add_argument(
39+
"-p",
40+
"--persist-user",
41+
action="store_true",
42+
help="permanently register the font",
43+
default=False,
44+
)
4545

46-
args = parser.parse_args()
46+
args = parser.parse_args()
4747

48-
if args.persist_user:
49-
scope = CoreText.kCTFontManagerScopeUser
50-
scopeDesc = "user"
51-
else:
52-
scope = CoreText.kCTFontManagerScopeSession
53-
scopeDesc = "session"
54-
55-
failureCount = 0
56-
for fontPath in args.file:
57-
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
58-
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
59-
if result:
60-
print(
61-
"%sregistered font %s with %s scope"
62-
% (("un" if args.unregister else ""), fontPath, scopeDesc)
63-
)
48+
if args.persist_user:
49+
scope = CoreText.kCTFontManagerScopeUser
50+
scopeDesc = "user"
6451
else:
65-
print(
66-
"Failed to %sregister font %s with %s scope"
67-
% (("un" if args.unregister else ""), fontPath, scopeDesc)
68-
)
69-
if args.verbose:
70-
print(error)
71-
failureCount += 1
52+
scope = CoreText.kCTFontManagerScopeSession
53+
scopeDesc = "session"
54+
55+
failureCount = 0
56+
for fontPath in args.file:
57+
fontURL = Cocoa.NSURL.fileURLWithPath_(fontPath)
58+
(result, error) = register_or_unregister_font(fontURL, args.unregister, scope)
59+
if result:
60+
print(
61+
"%sregistered font %s with %s scope"
62+
% (("un" if args.unregister else ""), fontPath, scopeDesc)
63+
)
64+
else:
65+
print(
66+
"Failed to %sregister font %s with %s scope"
67+
% (("un" if args.unregister else ""), fontPath, scopeDesc)
68+
)
69+
if args.verbose:
70+
print(error)
71+
failureCount += 1
7272

73-
sys.exit(failureCount)
73+
sys.exit(failureCount)
7474

7575

7676
def register_or_unregister_font(fontURL, unregister, scope):
77-
return (
78-
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
79-
if unregister
80-
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
81-
)
77+
return (
78+
CoreText.CTFontManagerUnregisterFontsForURL(fontURL, scope, None)
79+
if unregister
80+
else CoreText.CTFontManagerRegisterFontsForURL(fontURL, scope, None)
81+
)
8282

8383

8484
if __name__ == "__main__":
85-
main()
85+
main()

0 commit comments

Comments
 (0)