mirror of
https://github.com/zen-browser/desktop.git
synced 2026-09-12 19:50:13 +05:00
chore: Update external mochitests, b=no-bug, c=tests, scripts, common
This commit is contained in:
parent
466d089fc0
commit
604365dd38
@ -18,10 +18,18 @@ FILE_PREFIX = """
|
|||||||
# This file is autogenerated by scripts/import_external_tests.py
|
# This file is autogenerated by scripts/import_external_tests.py
|
||||||
# Do not edit manually.
|
# Do not edit manually.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
BROWSER_MANIFEST_LIST_PREFIX = """
|
||||||
BROWSER_CHROME_MANIFESTS += [
|
BROWSER_CHROME_MANIFESTS += [
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
XPCSHELL_MANIFESTS_LIST_PREFIX = """
|
||||||
|
XPCSHELL_TESTS_MANIFESTS += [
|
||||||
|
"""
|
||||||
|
|
||||||
FILE_SUFFIX = "]"
|
FILE_SUFFIX = "]"
|
||||||
|
VALID_MANIFEST_FILES = ["browser.toml", "xpcshell.toml"]
|
||||||
|
|
||||||
|
|
||||||
def get_tests_manifest():
|
def get_tests_manifest():
|
||||||
@ -38,12 +46,17 @@ def validate_tests_path(path, files, ignore_list):
|
|||||||
for ignore in ignore_list:
|
for ignore in ignore_list:
|
||||||
if ignore not in files:
|
if ignore not in files:
|
||||||
die_with_error(f"Ignore file '{ignore}' not found in tests folder '{path}'")
|
die_with_error(f"Ignore file '{ignore}' not found in tests folder '{path}'")
|
||||||
if "browser.toml" not in files or "browser.js" in ignore_list:
|
if not any(manifest_file in files for manifest_file in VALID_MANIFEST_FILES):
|
||||||
die_with_error(f"'browser.toml' not found in tests folder '{path}'")
|
die_with_error(f"None of the valid manifest files {VALID_MANIFEST_FILES} found in tests folder '{path}'")
|
||||||
|
|
||||||
|
|
||||||
def disable_and_replace_manifest(manifest, output_path):
|
def disable_and_replace_manifest(manifest, output_path):
|
||||||
toml_file = os.path.join(output_path, "browser.toml")
|
toml_file = None
|
||||||
|
for manifest_file in VALID_MANIFEST_FILES:
|
||||||
|
candidate = os.path.join(output_path, manifest_file)
|
||||||
|
if os.path.exists(candidate):
|
||||||
|
toml_file = candidate
|
||||||
|
break
|
||||||
disabled_tests = manifest.get("disable", [])
|
disabled_tests = manifest.get("disable", [])
|
||||||
with open(toml_file, "r") as f:
|
with open(toml_file, "r") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
@ -90,9 +103,18 @@ def write_moz_build_file(manifest):
|
|||||||
print(f"Writing moz.build file to '{moz_build_path}'")
|
print(f"Writing moz.build file to '{moz_build_path}'")
|
||||||
with open(moz_build_path, "w") as f:
|
with open(moz_build_path, "w") as f:
|
||||||
f.write(FILE_PREFIX)
|
f.write(FILE_PREFIX)
|
||||||
|
f.write(BROWSER_MANIFEST_LIST_PREFIX)
|
||||||
for test_suite in manifest.keys():
|
for test_suite in manifest.keys():
|
||||||
|
# add for browser.toml first
|
||||||
|
if not manifest[test_suite].get("xpcshell", False):
|
||||||
f.write(f'\t"{test_suite}/browser.toml",\n')
|
f.write(f'\t"{test_suite}/browser.toml",\n')
|
||||||
f.write(FILE_SUFFIX)
|
f.write(FILE_SUFFIX)
|
||||||
|
f.write(XPCSHELL_MANIFESTS_LIST_PREFIX)
|
||||||
|
for test_suite in manifest.keys():
|
||||||
|
# add for xpcshell.toml
|
||||||
|
if manifest[test_suite].get("xpcshell", False):
|
||||||
|
f.write(f'\t"{test_suite}/xpcshell.toml",\n')
|
||||||
|
f.write(FILE_SUFFIX)
|
||||||
|
|
||||||
|
|
||||||
def make_sure_ordered_tests(manifest):
|
def make_sure_ordered_tests(manifest):
|
||||||
|
|||||||
@ -56,7 +56,7 @@ def main():
|
|||||||
os.chdir(engine_dir)
|
os.chdir(engine_dir)
|
||||||
|
|
||||||
def run_mach_with_paths(test_paths):
|
def run_mach_with_paths(test_paths):
|
||||||
command = ['./mach', 'mochitest'] + other_args + test_paths
|
command = ['./mach', 'test'] + other_args + test_paths
|
||||||
# Replace the current process with the mach command
|
# Replace the current process with the mach command
|
||||||
os.execvp(command[0], command)
|
os.execvp(command[0], command)
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
:host(:is(.anonymous-content-host, notification-message)),
|
:host(:is(.anonymous-content-host, notification-message)),
|
||||||
:root {
|
:root:not([windowtype^="Browser:"]) {
|
||||||
/* Default values */
|
/* Default values */
|
||||||
--zen-border-radius: 7px;
|
--zen-border-radius: 7px;
|
||||||
--zen-primary-color: AccentColor;
|
--zen-primary-color: AccentColor;
|
||||||
|
|||||||
@ -6,9 +6,12 @@
|
|||||||
# This file is autogenerated by scripts/import_external_tests.py
|
# This file is autogenerated by scripts/import_external_tests.py
|
||||||
# Do not edit manually.
|
# Do not edit manually.
|
||||||
|
|
||||||
|
|
||||||
BROWSER_CHROME_MANIFESTS += [
|
BROWSER_CHROME_MANIFESTS += [
|
||||||
"safebrowsing/browser.toml",
|
"safebrowsing/browser.toml",
|
||||||
"sandbox/browser.toml",
|
"sandbox/browser.toml",
|
||||||
"shell/browser.toml",
|
"shell/browser.toml",
|
||||||
"tooltiptext/browser.toml",
|
"tooltiptext/browser.toml",
|
||||||
]
|
]
|
||||||
|
XPCSHELL_TESTS_MANIFESTS += [
|
||||||
|
]
|
||||||
@ -682,13 +682,6 @@ async function testFileAccessWindowsOnly() {
|
|||||||
let tests = [];
|
let tests = [];
|
||||||
|
|
||||||
let extDir = GetPerUserExtensionDir();
|
let extDir = GetPerUserExtensionDir();
|
||||||
// We used to unconditionally create this directory from Firefox, but that
|
|
||||||
// was dropped in bug 2001887. The value of this directory is questionable;
|
|
||||||
// the test was added in Firefox 56 (bug 1403744) to cover legacy add-ons,
|
|
||||||
// but legacy add-on support was discontinued in Firefox 57, and we stopped
|
|
||||||
// sideloading add-ons from this directory on all builds except ESR in
|
|
||||||
// Firefox 74 (bug 1602840).
|
|
||||||
await IOUtils.makeDirectory(extDir.path);
|
|
||||||
tests.push({
|
tests.push({
|
||||||
desc: "per-user extensions dir",
|
desc: "per-user extensions dir",
|
||||||
ok: true,
|
ok: true,
|
||||||
|
|||||||
@ -22,13 +22,6 @@ add_setup(async function setup() {
|
|||||||
const xdgConfigHome = Services.env.get("XDG_CONFIG_HOME");
|
const xdgConfigHome = Services.env.get("XDG_CONFIG_HOME");
|
||||||
Assert.greater(xdgConfigHome.length, 1, "XDG_CONFIG_HOME is defined");
|
Assert.greater(xdgConfigHome.length, 1, "XDG_CONFIG_HOME is defined");
|
||||||
|
|
||||||
// Verify the profile directory is inside XDG_CONFIG_HOME
|
|
||||||
const profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
|
||||||
Assert.ok(
|
|
||||||
profileDir.path.startsWith(xdgConfigHome),
|
|
||||||
`Profile directory (${profileDir.path}) should be inside XDG_CONFIG_HOME (${xdgConfigHome})`
|
|
||||||
);
|
|
||||||
|
|
||||||
// If it is there, do actual testing
|
// If it is there, do actual testing
|
||||||
sanityChecks();
|
sanityChecks();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -12,14 +12,11 @@ support-files = [
|
|||||||
"browser_content_sandbox_utils.js",
|
"browser_content_sandbox_utils.js",
|
||||||
"browser_content_sandbox_fs_tests.js",
|
"browser_content_sandbox_fs_tests.js",
|
||||||
]
|
]
|
||||||
test-directories = [
|
# .config needs to exists for the sandbox to properly add it
|
||||||
"/tmp/.xdg_default_test",
|
test-directories = ["/tmp/.xdg_default_test", "/tmp/.xdg_default_test/.config"]
|
||||||
"/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile",
|
|
||||||
]
|
|
||||||
environment = [
|
environment = [
|
||||||
"HOME=/tmp/.xdg_default_test",
|
"HOME=/tmp/.xdg_default_test",
|
||||||
]
|
]
|
||||||
profile-path = "/tmp/.xdg_default_test/.config/mozilla/firefox/xdg_default_profile"
|
|
||||||
|
|
||||||
["browser_content_sandbox_fs_xdg_default.js"]
|
["browser_content_sandbox_fs_xdg_default.js"]
|
||||||
run-if = ["os == 'linux'"]
|
run-if = ["os == 'linux'"]
|
||||||
|
|||||||
@ -12,17 +12,12 @@ support-files = [
|
|||||||
"browser_content_sandbox_utils.js",
|
"browser_content_sandbox_utils.js",
|
||||||
"browser_content_sandbox_fs_tests.js",
|
"browser_content_sandbox_fs_tests.js",
|
||||||
]
|
]
|
||||||
test-directories = [
|
test-directories = ["/tmp/.xdg_mozLegacyHome_test/.config", "/tmp/.xdg_config_home_test"]
|
||||||
"/tmp/.xdg_mozLegacyHome_test/.config",
|
|
||||||
"/tmp/.xdg_config_home_test",
|
|
||||||
"/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile",
|
|
||||||
]
|
|
||||||
environment = [
|
environment = [
|
||||||
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
||||||
"HOME=/tmp/.xdg_mozLegacyHome_test",
|
"HOME=/tmp/.xdg_mozLegacyHome_test",
|
||||||
"MOZ_LEGACY_HOME=1",
|
"MOZ_LEGACY_HOME=1",
|
||||||
]
|
]
|
||||||
profile-path = "/tmp/.xdg_mozLegacyHome_test/.mozilla/firefox/xdg_mozLegacyHome_profile"
|
|
||||||
|
|
||||||
["browser_content_sandbox_fs_xdg_mozLegacyHome.js"]
|
["browser_content_sandbox_fs_xdg_mozLegacyHome.js"]
|
||||||
run-if = ["os == 'linux'"]
|
run-if = ["os == 'linux'"]
|
||||||
|
|||||||
@ -11,15 +11,11 @@ support-files = [
|
|||||||
"browser_content_sandbox_utils.js",
|
"browser_content_sandbox_utils.js",
|
||||||
"browser_content_sandbox_fs_tests.js",
|
"browser_content_sandbox_fs_tests.js",
|
||||||
]
|
]
|
||||||
test-directories = [
|
test-directories = "/tmp/.xdg_config_home_test"
|
||||||
"/tmp/.xdg_config_home_test",
|
|
||||||
"/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile",
|
|
||||||
]
|
|
||||||
environment = [
|
environment = [
|
||||||
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
"XDG_CONFIG_HOME=/tmp/.xdg_config_home_test",
|
||||||
"MOZ_LEGACY_HOME=0",
|
"MOZ_LEGACY_HOME=0",
|
||||||
]
|
]
|
||||||
profile-path = "/tmp/.xdg_config_home_test/mozilla/firefox/xdg_config_home_profile"
|
|
||||||
|
|
||||||
["browser_content_sandbox_fs_xdg_xdgConfigHome.js"]
|
["browser_content_sandbox_fs_xdg_xdgConfigHome.js"]
|
||||||
run-if = [
|
run-if = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user