Created
March 3, 2025 18:24
-
-
Save zombie/07d981a100fc163e01cf4ee5d9f0329f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/tools/wptrunner/wptrunner/executors/executormarionette.py b/tools/wptrunner/wptrunner/executors/executormarionette.py | |
| index ebc4a4a565..c779ea4258 100644 | |
| --- a/tools/wptrunner/wptrunner/executors/executormarionette.py | |
| +++ b/tools/wptrunner/wptrunner/executors/executormarionette.py | |
| @@ -46,6 +46,7 @@ from .protocol import (AccessibilityProtocolPart, | |
| VirtualSensorProtocolPart, | |
| DevicePostureProtocolPart, | |
| VirtualPressureSourceProtocolPart, | |
| + WebExtensionsProtocolPart, | |
| merge_dicts) | |
| @@ -727,6 +728,20 @@ class MarionetteVirtualPressureSourceProtocolPart(VirtualPressureSourceProtocolP | |
| def remove_virtual_pressure_source(self, source_type): | |
| raise NotImplementedError("remove_virtual_pressure_source not yet implemented") | |
| +class MarionetteWebExtensionsProtocolPart(WebExtensionsProtocolPart): | |
| + def setup(self): | |
| + self.marionette = self.parent.marionette | |
| + | |
| + def load_web_extension(self, extension): | |
| + if extension["type"] == "path" and self.parent.test_dir: | |
| + extension["path"] = self.parent.test_dir + extension["path"] | |
| + | |
| + addons = Addons(self.marionette) | |
| + return addons.install(extension["path"], True) | |
| + | |
| + def unload_web_extension(self, extension_id): | |
| + addons = Addons(self.marionette) | |
| + return addons.uninstall(extension_id) | |
| class MarionetteProtocol(Protocol): | |
| implements = [MarionetteBaseProtocolPart, | |
| @@ -750,7 +765,8 @@ class MarionetteProtocol(Protocol): | |
| MarionetteAccessibilityProtocolPart, | |
| MarionetteVirtualSensorProtocolPart, | |
| MarionetteDevicePostureProtocolPart, | |
| - MarionetteVirtualPressureSourceProtocolPart] | |
| + MarionetteVirtualPressureSourceProtocolPart, | |
| + MarionetteWebExtensionsProtocolPart] | |
| def __init__(self, executor, browser, capabilities=None, timeout_multiplier=1, e10s=True, ccov=False): | |
| do_delayed_imports() | |
| @@ -939,6 +955,7 @@ class MarionetteTestharnessExecutor(TestharnessExecutor): | |
| self.protocol.testharness.load_runner(new_environment["protocol"]) | |
| def do_test(self, test): | |
| + self.protocol.test_dir = os.path.dirname(test.path) | |
| timeout = (test.timeout * self.timeout_multiplier if self.debug_info is None | |
| else None) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment