diff --git a/testing/marionette/harness/marionette_harness/runner/base.py b/testing/marionette/harness/marionette_harness/runner/base.py index 6cb6aca093ab..926aa12c35a6 100644 --- a/testing/marionette/harness/marionette_harness/runner/base.py +++ b/testing/marionette/harness/marionette_harness/runner/base.py @@ -421,6 +421,13 @@ class BaseMarionetteArguments(ArgumentParser): help="Enable python post-mortem debugger when a test fails." " Pass in the debugger you want to use, eg pdb or ipdb.", ) + self.add_argument( + "--disable-actors", + action="store_true", + dest="disable_actors", + default=False, + help="Disable the usage of JSWindowActors in Marionette.", + ) self.add_argument( "--enable-fission", action="store_true", @@ -650,8 +657,9 @@ class BaseMarionetteTestRunner(object): verbose=0, emulator=False, headless=False, - enable_webrender=False, + disable_actors=False, enable_fission=False, + enable_webrender=False, **kwargs ): self._appName = None @@ -697,6 +705,14 @@ class BaseMarionetteTestRunner(object): self.headless = headless self.enable_webrender = enable_webrender + self.disable_actors = disable_actors + if self.disable_actors: + self.prefs.update( + { + "marionette.actors.enabled": False, + } + ) + self.enable_fission = enable_fission if self.enable_fission: self.prefs.update( @@ -1138,6 +1154,7 @@ class BaseMarionetteTestRunner(object): "appname": self.appName, "manage_instance": self.marionette.instance is not None, "headless": self.headless, + "actors": not self.disable_actors, "webrender": self.enable_webrender, } ) diff --git a/testing/marionette/harness/marionette_harness/tests/harness_unit/test_marionette_runner.py b/testing/marionette/harness/marionette_harness/tests/harness_unit/test_marionette_runner.py index 35077dd47d9c..06c3c14448b2 100644 --- a/testing/marionette/harness/marionette_harness/tests/harness_unit/test_marionette_runner.py +++ b/testing/marionette/harness/marionette_harness/tests/harness_unit/test_marionette_runner.py @@ -372,9 +372,17 @@ def test_manifest_basic_args(mock_runner, manifest, monkeypatch): assert kwargs["exists"] is False assert kwargs["disabled"] is True assert kwargs["appname"] == "fake_app" + assert kwargs["actors"] is True assert "mozinfo_key" in kwargs and kwargs["mozinfo_key"] == "mozinfo_val" +def test_manifest_actors_disabled(mock_runner, manifest, monkeypatch): + kwargs = get_kwargs_passed_to_manifest( + mock_runner, manifest, monkeypatch, disable_actors=True + ) + assert kwargs["actors"] is False + + @pytest.mark.parametrize("test_tags", (None, ["tag", "tag2"])) def test_manifest_with_test_tags(mock_runner, manifest, monkeypatch, test_tags): kwargs = get_kwargs_passed_to_manifest( diff --git a/testing/mozharness/scripts/marionette.py b/testing/mozharness/scripts/marionette.py index 5b051fa6f4ee..500265663ccf 100755 --- a/testing/mozharness/scripts/marionette.py +++ b/testing/mozharness/scripts/marionette.py @@ -144,6 +144,15 @@ class MarionetteTest(TestingMixin, MercurialScript, TransferMixin, CodeCoverageM "help": "Permits a software GL implementation (such as LLVMPipe) to use the GL compositor.", # NOQA: E501 }, ], + [ + ["--disable-actors"], + { + "action": "store_true", + "dest": "disable_actors", + "default": False, + "help": "Disable the usage of JSWindowActors in Marionette.", + }, + ], [ ["--enable-webrender"], { @@ -338,6 +347,9 @@ class MarionetteTest(TestingMixin, MercurialScript, TransferMixin, CodeCoverageM if self.config.get("app_arg"): config_fmt_args["app_arg"] = self.config["app_arg"] + if self.config["disable_actors"]: + cmd.append("--disable-actors") + if self.config["enable_webrender"]: cmd.append("--enable-webrender")