Skip to content

Commit

Permalink
Use fake GMP plugins in wpt from mach.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D228948

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1534688
gecko-commit: b3a2a30a0e289f734c0daeb663282ad6fbd3d777
gecko-reviewers: media-playback-reviewers, jgraham, webrtc-reviewers, bwc, padenot
  • Loading branch information
Pehrsons authored and moz-wptsync-bot committed Nov 20, 2024
1 parent 7391b51 commit 79ffeb2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 16 additions & 10 deletions tools/wptrunner/wptrunner/browsers/firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ def browser_kwargs(logger, test_type, run_info_data, config, subsuite, **kwargs)
"disable_fission": kwargs["disable_fission"],
"stackfix_dir": kwargs["stackfix_dir"],
"binary_args": kwargs["binary_args"].copy(),
"timeout_multiplier": get_timeout_multiplier(test_type,
run_info_data,
**kwargs),
"timeout_multiplier": get_timeout_multiplier(test_type, run_info_data, **kwargs),
"leak_check": run_info_data["debug"] and (kwargs["leak_check"] is not False),
"asan": run_info_data.get("asan"),
"chaos_mode_flags": kwargs["chaos_mode_flags"],
Expand All @@ -133,6 +131,7 @@ def browser_kwargs(logger, test_type, run_info_data, config, subsuite, **kwargs)
"preload_browser": kwargs["preload_browser"] and not kwargs["pause_after_test"] and not kwargs["num_test_groups"] == 1,
"specialpowers_path": kwargs["specialpowers_path"],
"allow_list_paths": kwargs["allow_list_paths"],
"gmp_path": kwargs["gmp_path"] if "gmp_path" in kwargs else None,
"debug_test": kwargs["debug_test"]}
if test_type == "wdspec" and kwargs["binary"]:
browser_kwargs["webdriver_args"].extend(["--binary", kwargs["binary"]])
Expand Down Expand Up @@ -272,7 +271,7 @@ def log_gecko_crashes(logger, process, test, profile_dir, symbols_path, stackwal
return False


def get_environ(logger, binary, debug_info, headless, chaos_mode_flags=None, e10s=True):
def get_environ(logger, binary, debug_info, headless, gmp_path, chaos_mode_flags=None, e10s=True):
# Hack: test_environment expects a bin_suffix key in mozinfo that in gecko infrastructure
# is set in the build system. Set it manually here.
if "bin_suffix" not in mozinfo.info:
Expand All @@ -288,6 +287,8 @@ def get_environ(logger, binary, debug_info, headless, chaos_mode_flags=None, e10
log=logger).items()
if value is not None}

if gmp_path is not None:
env["MOZ_GMP_PATH"] = gmp_path
# Disable window occlusion. Bug 1733955
env["MOZ_WINDOW_OCCLUSION"] = "0"
if chaos_mode_flags is not None:
Expand Down Expand Up @@ -319,7 +320,7 @@ class FirefoxInstanceManager:

def __init__(self, logger, binary, binary_args, profile_creator, debug_info,
chaos_mode_flags, headless,
leak_check, stackfix_dir, symbols_path, asan, e10s):
leak_check, stackfix_dir, symbols_path, gmp_path, asan, e10s):
"""Object that manages starting and stopping instances of Firefox."""
self.logger = logger
self.binary = binary
Expand All @@ -331,6 +332,7 @@ def __init__(self, logger, binary, binary_args, profile_creator, debug_info,
self.leak_check = leak_check
self.stackfix_dir = stackfix_dir
self.symbols_path = symbols_path
self.gmp_path = gmp_path
self.asan = asan
self.e10s = e10s

Expand Down Expand Up @@ -369,7 +371,8 @@ def start(self):
profile.set_preferences({"marionette.port": marionette_port})

env = get_environ(self.logger, self.binary, self.debug_info,
self.headless, self.chaos_mode_flags, self.e10s)
self.headless, self.gmp_path, self.chaos_mode_flags,
self.e10s)

args = self.binary_args[:] if self.binary_args else []
args += [cmd_arg("marionette"), "about:blank"]
Expand Down Expand Up @@ -806,7 +809,8 @@ def __init__(self, logger, binary, package_name, prefs_root, test_type,
stackfix_dir=None, binary_args=None, timeout_multiplier=None, leak_check=False,
asan=False, chaos_mode_flags=None, config=None,
browser_channel="nightly", headless=None, preload_browser=False,
specialpowers_path=None, debug_test=False, allow_list_paths=None, **kwargs):
specialpowers_path=None, debug_test=False, allow_list_paths=None,
gmp_path=None, **kwargs):
Browser.__init__(self, logger)

self.logger = logger
Expand Down Expand Up @@ -854,6 +858,7 @@ def __init__(self, logger, binary, package_name, prefs_root, test_type,
leak_check,
stackfix_dir,
symbols_path,
gmp_path,
asan,
e10s)

Expand Down Expand Up @@ -911,7 +916,7 @@ def __init__(self, logger, binary, package_name, prefs_root, webdriver_binary, w
disable_fission=False, stackfix_dir=None, leak_check=False,
asan=False, chaos_mode_flags=None, config=None, browser_channel="nightly",
headless=None, debug_test=False, profile_creator_cls=ProfileCreator,
allow_list_paths=None, **kwargs):
allow_list_paths=None, gmp_path=None, **kwargs):

super().__init__(logger, binary, webdriver_binary, webdriver_args)
self.binary = binary
Expand All @@ -926,7 +931,7 @@ def __init__(self, logger, binary, package_name, prefs_root, webdriver_binary, w
self.leak_check = leak_check
self.leak_report_file = None

self.env = self.get_env(binary, debug_info, headless, chaos_mode_flags, e10s)
self.env = self.get_env(binary, debug_info, headless, gmp_path, chaos_mode_flags, e10s)

profile_creator = profile_creator_cls(logger,
prefs_root,
Expand All @@ -945,11 +950,12 @@ def __init__(self, logger, binary, package_name, prefs_root, webdriver_binary, w
self.profile = profile_creator.create()
self.marionette_port = None

def get_env(self, binary, debug_info, headless, chaos_mode_flags, e10s):
def get_env(self, binary, debug_info, headless, gmp_path, chaos_mode_flags, e10s):
env = get_environ(self.logger,
binary,
debug_info,
headless,
gmp_path,
chaos_mode_flags, e10s)
env["RUST_BACKTRACE"] = "1"
return env
Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/browsers/firefox_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def stop(self, force=False):
self.logger.warning("Failed to remove forwarded or reversed ports: %s" % e)
super().stop(force=force)

def get_env(self, binary, debug_info, headless, chaos_mode_flags, e10s):
def get_env(self, binary, debug_info, headless, gmp_path, chaos_mode_flags, e10s):
env = get_environ(chaos_mode_flags)
env["RUST_BACKTRACE"] = "1"
return env
Expand Down

0 comments on commit 79ffeb2

Please sign in to comment.