Skip to content

Commit

Permalink
Merge pull request #177 from asajeffrey/master
Browse files Browse the repository at this point in the history
Added --binary-arg option, which passes an argument to the browser binary.
  • Loading branch information
jgraham committed Mar 31, 2016
2 parents 9f5f91e + bf32945 commit 357411c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions wptrunner/browsers/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def check_args(**kwargs):
def browser_kwargs(**kwargs):
return {"binary": kwargs["binary"],
"debug_info": kwargs["debug_info"],
"binary_args": kwargs["binary_args"],
"user_stylesheets": kwargs.get("user_stylesheets"),
"render_backend": kwargs.get("servo_backend")}

Expand Down Expand Up @@ -58,20 +59,22 @@ def update_properties():


def render_arg(render_backend):
return {"cpu": "--cpu", "webrender": "--webrender"}[render_backend]
return {"cpu": "--cpu", "webrender": "-w"}[render_backend]


class ServoBrowser(NullBrowser):
def __init__(self, logger, binary, debug_info=None, user_stylesheets=None,
render_backend="cpu"):
def __init__(self, logger, binary, debug_info=None, binary_args=None,
user_stylesheets=None, render_backend="cpu"):
NullBrowser.__init__(self, logger)
self.binary = binary
self.debug_info = debug_info
self.binary_args = binary_args or []
self.user_stylesheets = user_stylesheets or []
self.render_backend = render_backend

def executor_browser(self):
return ExecutorBrowser, {"binary": self.binary,
"debug_info": self.debug_info,
"binary_args": self.binary_args,
"user_stylesheets": self.user_stylesheets,
"render_backend": self.render_backend}
1 change: 1 addition & 0 deletions wptrunner/executors/executorservo.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def do_test(self, test):
args += ["--user-stylesheet", stylesheet]
for pref in test.environment.get('prefs', {}):
args += ["--pref", pref]
args += self.browser.binary_args
debug_args, command = browser_command(self.binary, args, self.debug_info)

self.command = command
Expand Down
6 changes: 3 additions & 3 deletions wptrunner/wptcommandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def create_parser(product_choices=None):

parser.add_argument("--binary", action="store",
type=abs_path, help="Binary to run tests against")
parser.add_argument('--binary-arg',
default=[], action="append", dest="binary_args",
help="Extra argument for the binary (servo)")
parser.add_argument("--webdriver-binary", action="store", metavar="BINARY",
type=abs_path, help="WebDriver server binary to use")
parser.add_argument("--processes", action="store", type=int, default=None,
Expand Down Expand Up @@ -128,9 +131,6 @@ def create_parser(product_choices=None):
debugging_group.add_argument("--stackwalk-binary", action="store", type=abs_path,
help="Path to stackwalker program used to analyse minidumps.")

debugging_group.add_argument("--pdb", action="store_true",
help="Drop into pdb on python exception")

chunking_group = parser.add_argument_group("Test Chunking")
chunking_group.add_argument("--total-chunks", action="store", type=int, default=1,
help="Total number of chunks to use")
Expand Down

0 comments on commit 357411c

Please sign in to comment.