Skip to content

Commit

Permalink
Bug 1707876 - Remove browsers.base.inherit and remaining useage, r=wh…
Browse files Browse the repository at this point in the history
…imboo

This was designed to allow reusing configuration across browsers, but
in practice it's only used once and is adding additional complexity
that isn't merited by the amount of use.

Differential Revision: https://phabricator.services.mozilla.com/D113670
  • Loading branch information
jgraham committed May 19, 2021
1 parent 4aed9f4 commit 48341f4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,12 @@
import platform
import socket
from abc import ABCMeta, abstractmethod
from copy import deepcopy

from ..wptcommandline import require_arg # noqa: F401

here = os.path.dirname(__file__)


def inherit(super_module, child_globals, product_name):
super_wptrunner = super_module.__wptrunner__
child_globals["__wptrunner__"] = child_wptrunner = deepcopy(super_wptrunner)

child_wptrunner["product"] = product_name

for k in ("check_args", "browser", "browser_kwargs", "executor_kwargs",
"env_extras", "env_options", "timeout_multiplier"):
attr = super_wptrunner[k]
child_globals[attr] = getattr(super_module, attr)

for v in super_module.__wptrunner__["executor"].values():
child_globals[v] = getattr(super_module, v)

if "run_info_extras" in super_wptrunner:
attr = super_wptrunner["run_info_extras"]
child_globals[attr] = getattr(super_module, attr)


def cmd_arg(name, value=None):
prefix = "-" if platform.system() == "Windows" else "--"
rv = prefix + name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
from .base import inherit
from . import edge
from .base import NullBrowser # noqa: F401
from .edge import (EdgeBrowser, # noqa: F401
EdgeDriverWdspecExecutor, # noqa: F401
check_args, # noqa: F401
browser_kwargs, # noqa: F401
executor_kwargs, # noqa: F401
env_extras, # noqa: F401
env_options, # noqa: F401
run_info_extras, # noqa: F401
get_timeout_multiplier) # noqa: F401

from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
WebDriverRefTestExecutor) # noqa: F401


inherit(edge, globals(), "edge_webdriver")

# __wptrunner__ magically appears from inherit, F821 is undefined name
__wptrunner__["executor"]["testharness"] = "WebDriverTestharnessExecutor" # noqa: F821
__wptrunner__["executor"]["reftest"] = "WebDriverRefTestExecutor" # noqa: F821
__wptrunner__ = {"product": "edge_webdriver",
"check_args": "check_args",
"browser": {None: "EdgeBrowser",
"wdspec": "NullBrowser"},
"executor": {"testharness": "WebDriverTestharnessExecutor",
"reftest": "WebDriverRefTestExecutor",
"wdspec": "EdgeDriverWdspecExecutor"},
"browser_kwargs": "browser_kwargs",
"executor_kwargs": "executor_kwargs",
"env_extras": "env_extras",
"env_options": "env_options",
"run_info_extras": "run_info_extras",
"timeout_multiplier": "get_timeout_multiplier"}

0 comments on commit 48341f4

Please sign in to comment.